How to make a HDRI Sky-Dome

The first experiment

In my previous post I said that I was going to begin the experiments by taking a photograph and seeing if I could replicate that photograph in 3D. Today I spent some time preparing all of the files that I’d need and thought I’d share my workflow with others who are trying to achieve a similar result. If you are already familiar equirectangular high dynamic range panorama I’d skip this post, otherwise, read on…

First of all, here is the photograph that I’m going to try and recreate:

In this first experiment though I’m not going to try and recreate the whole image in 3D, instead, I’m going to remove the grey balls, take another photograph, and use that photograph as a background. I will then try to recreate the grey balls in CG to see if I can ‘fake’ the original image.

The first I thing I do when starting a project like this is to put my camera in manual mode and take a white balance measure using a Gretag Macbeth White Balance Card. This isn’t entirely necessary as I’ll correct the white balance again in post but I feel it is good practice to start with as accurate colour as possible.

With the white balance measured, I’ll then work on getting the right exposure. Depending on the lighting I set my camera’s aperture at either f8 or f11 as this usually results in the sharpest image whilst also reducing lens flair. As the lighting in this scenario is quite low and I won’t be taking photographs towards the sun, I used an aperture of f8 in order to allow more light into the lens.

Having determined the correct aperture I place my camera where my subject is going to appear, in this case where the grey balls used to be, and move my camera around and using the exposure meter I find the minimum and maximum shutter speeds that that I might need.

In the example, I needed a shutter speed of about 1/80th of a second to get correct exposure through the window, and a shutter speed of about 3 seconds to expose for the shadows in the corner of the room.

My next task is to set the shutter speed half way between these two values and take a picture of a colour chart. Again, I use the Gretag Macbeth card for this purpose (More on the colour correction later).

With my white balance, maximum shutter speed, minimum shutter speed and colour chart all measured, I work out how many pictures I need to get a true HDR Image. If you’ve not come across HDRI before, here’s a quick overview.

Whenever a photographer takes a photograph, he/she must decide how much light to allow through the lens. Too much and everything is overexposed, too little and everything is underexposed, either way, there’s great loss of detail. The photographer must make a compromise and try to find a middle point, accepting that they are going to lose some detail in the highlights and some in the shadows. With HDR imaging on the other hand this isn’t the case. Instead, you might take three photographs; one to expose for the highlights, one for the mid tones, and one for the shadows. You would then use software such as photoshop (File > Automate > Merge to HDR) to combine all three images into a single HDR image.

The difference in a HDR image to a normal image, is that the image contains information not just about what colour an individual pixel is, but more importantly, how bright it is. The benefit of this is that a HDR image can be used in 3D as a source of light (We’ll get to this later).

So, getting back to making my own HDRI, I worked out earlier that I need a maximum shutter speed of 2 seconds, and a minimum of 1/80th of a second. With these two figures in hand I work out how many exposures I will need to bridge the gap. To do this, I always try to start at the maximum and keep dividing by 2 until I reach the minimum.

So, if my first exposure is 2 seconds, my next is 1 second, then 1/2 a second, then 1/4, then 1/8th of a second. My Nikon D60 won’t do 1/16th of a second so I use 1/15th, then 1/30th and 1/60th of a second. The next increment would be 1/120th of a second, so I decide to stay at 1/60th as it is closer to the minimum shutter speed that I measured earlier. From this calculation I worked out that I will need 9 pictures to get a good exposure across the range.

However, I’m not just trying to capture a single HDR image, instead I’m trying to photograph the entire room. You might be familiar with shooting panoramic images where the camera is sometimes placed on a tripod and a series of images are taken as the tripod head is rotated about the horizontal axes (It’s actually rotated around the vertical axes, but it’s sometimes easier to think of it as being horizontal). To photograph the entire room I need to do something similar but I need to rotate my camera around both the vertical and horizontal axes. I will then stitch of all of the photos together into what is called an equirectangular image. This is where you photograph something that is spherical, and project it onto a flat surface, very similar to taking a picture of the earth and making it into a rectangular map. To photograph a spherical panorama I use a Nodal Ninja MkIII.

When shooting a full spherical panorama like this you need to be quick so that you can capture the entire scene before the natural light changes (in this case the light coming through the window). Obviously, if you’re shooting in artificial light, this doesn’t matter so much.

As a side note, when I first did this I used an 18mm lens on my camera that would require taking over a thousand photographs to get a full spherical HDRI panorama. I now use a 10mm lens that requires I take about 250 images to capture all of the light that’s bouncing around the room.

To insure there is no movement in the camera so that the different exposures can be perfectly aligned I connect my camera to a laptop and operate the camera remotely.

With this set up I take a photograph with a 2 second shutter speed, reduce the shutter speed by half and take another photograph. Taking 9 intervals until I reach 1/60th of a second. I then rotate my Nodal Ninja MkIII by 25.7 degrees and capture another 9 exposures.

I use 25.7 degrees because this gives the resulting images a 25% overlap using my 10mm lens and having a 25% overlap makes it easier to stitch the photographs together later on. The great thing about the Nodal Ninja is that it comes with plates that let you adjust how many degrees you want it to turn by each time. I set mine to 25.7 degrees and when I turn the Ninja, it clicks into place, ensuring that all my photographs have a perfect 25% overlap.

Once I’ve rotated a full 360 degrees horizontally, I adjust the vertical pivot and repeat the process. With a 10mm lens this needs to be repeated three times to capture the entire scene.

250 images later I’m ready to create the panorama.

Before I pack everything away I take another picture of the colour chart which I can use to correct the images later on if the light through the window has changed drastically whilst I’ve been taking the pictures. For good measure I also take some more pictures of the filing cabinet and record some video of the cabinet too in case I decide to create some animation at some point in the future.

With all of my photographs ready It’s time to correct them all, for this I use Adobe Lightroom. I import my picture of the Gretag Macbeth Colour Chart that I took originally and use the X-Rite colour checker plugin to measure the colours in the image. This gives me a colour profile that I then apply to the rest of the images, ensuring that all of the images taken have not only matching, but correct colour. For this to work, all of the images need to be in RAW format.

I also use the lens correction tool in Lightroom to remove the lens distortion and vignetting that I get from the 10mm lens. Finally, I resize all of my images and convert them to .tif file format. It would make my workflow quicker if the D60 I use could take RAW photographs (or .nef on the Nikon) at a lower resolution as it would save time in post, and save time writing to the memory card when the picture was originally taken. Alas, it does not so I have to resize them here. It’s a good idea to make all of the images smaller and convert to .tif because it will make it far easier for the stitching software to cope with the huge amount of data contained in the 250 photographs.

I use PTGui to stitch the pictures together because it’s clever enough to know that I want to create a HDR panorama and realises that I have taken the same image at different exposures.

In this instance I had to do quite a lot of manual adjustments (several hours) to help the stitching software because I’d moved the chair, door, curtains and wires on the floor whilst taking the photographs and the irregular position of overlapping elements in the image was confusing the software (clouds have a nasty habit of doing this too). Below however, is the final result.

I save the resulting HDR panorama in .hdr file format. You’ll notice that there is a large empty space in the bottom of the panorama. This is because the camera can’t magically shoot through your tripod. In this instance though, I knew the surface below the camera was very similar to the surrounding area so I just take it into Photoshop and use the clone stamp tool to fill the empty space.

I didn’t need to be too careful about getting a good blend here as I’ll be modelling a surface for the top of the filing cabinet later on.

With an equirectangular HDRI panorama ready, it’s time to use it in 3D to create the sky dome.