HDRI Tutorial

3d-visualizer

This tutorial was originally created in 2005. Wow. I was able to find it on one of my old hard drives. It’s still valid today and teaches you the basics of matching any 3D asset with a background plate.

On top of it, it also shows you how to create your own HDRI, how to setup probes on the set and how to match Global Illumination, Reflections and Light Values. And any HDRI can also be used inside the Unreal Engine using Real Time Ray Tracing. You’ll find more help and information in my Unreal Engine Tutorials.

This study will describe step by step how you can make your own HDRI images, and use for your render to get a photorealistic look.

Chapter Overview 

1. Preparations
2. Making your own HDRI probes
3. Making your reference probes
4. Assembling with HDR-SHOP
5. Matching HDRI-Reflection
6. Matching HDRI-Skylight
7. Final Render

Preparation

I don´t want to talk about mathematic, technic and function about HDRI. I will describe the practical use. An HDRI (High Dynmaic Range Image) is a shot from one image with different shutter speed. Every single image with all the different shutter speed were merged to one single image and saved as .hdr file. Years ago, the film industry recognized that this is a way to catch different levels of light, which is useful for rendering.

Which things are needed for using the HDRI-Technic ?

a) a digital cam
b) 3 spheres with a radius from 10 bis 30cm, and of it
– one silver, full reflective, mirroring sphere
– one white, matte sphere
– one grey, matte spherel
c) a tripod for your cam
d) a kind of tripod for your spheres
e) a white board
f) a little table
g) your laptop
h) the software HDR-Shop (download from Paul´s website www.debevec.org)
i) one free or for commercial use 3d software
j) a render

The following image shows all needed instruments for making the HDR Images. Except the cam, we needed to make this photo.

Cam: If you have the choice you should choose a digital cam with remotecontrol. So you can connect your cam with your laptop. If you don´t have this feature, than it would be good to have a timer on your cam.

That´s important, because I could see, that you can get lot´s of distortions in your image, because your hand isn´t still enough for a longer shutter speed. Without that, it´s not possible to get a 100% sharp HDRI.

Sphere for the probes: The probes are nothing more than simply spheres you can get in every super market store. If you ask for spheres which you can use in the garden for your roses, than you are on the right way. I could also see, that you can use spheres you usualy find on christmas trees. In my case, I used simple spheres, which you can open. The core is hollow and not massive.

It is important that you will get three spheres, witht the same dimension and size, but with different materials and colors. Following is the description of things you will require in this…

  1. Sphere: It´s the mirror/reflection sphere and the material looks like a flat mirror. This sphere reflects the environment and you use this for the reflection probe.
  2. 3 Spheres: One sphere should be white and the other one grey. The basic material should not reflect. An addition would be a black sphere, but with white and grey you will get great results.
  1. The Tripod: The tripod should fit to your cam. It´s important that not every easily gust of wind will blow your tripod away.
  2. The Tripod for your spheres: This is a very creative point. A very good solution is a sunning screen, which are very cheap to get. And it´s important that you have a linkage or something like this. In this you can fit a round bar and fit the sphere on it.
  3. White Board: The white board will be used for the white alignment.
  4. Little Table: A little table where you can put your laptop on, it´s really I can recommend.
  5. Laptop: Required any description ?
  6. HDR-SHOP: The HDR Shop you can download for non commercial use free from www.debevec.org. There are other software packages out you could use, but in this tutorial I will use HDR-SHOP only.
  7. Free or Commercial 3D software: As instance, Blender is a free software you could use. Other solutions are 3dsmax, Cinema 4D, Lightwave, Maya, Softimage, etc.
  8. Render: Usually you will get with common 3d software packages render systems. But also you can get render plugins like Splutterfish Brazil or V-Ray from Chaosgroup.

Making your own HDRI Probes

a) Location: Think about where you want to make your snapshots and what you want to photograph. For your first try I would recommend to choose a simple living room before you try an exterior shot. You should get ready with your cam and software. For this study I´ve choosen a simple possibility, that means, the final shot should record the environment and a 3d object.

b) White Balance: Before you start shooting your first images, you should make a white balance. How to do that, you should read in your manual of your camera. For that, use the white board.

c) Setup your tripod, the spheres and your camera: Put the camera on your tripod. On the same height and 1 meter in front of your camera, you position the linkage with the silver reflection sphere. Your camera shows direclty to the sphere (front view). Now put the camera 1 meter in front of your sphere, and watch out that you will get the same height as the sphere. You should see the whole sphere on your camera. For that, select the right zoom. Now get sure, that you can make the photo with your remote control, and that you have activated your automatic modus. So you can see if your sphere is 100% sharp and correct on your photograph.

If this photograph is perfect, choose on your camera the best pixel solution. Now change your modus to manual, and choose for each photo a different shutter speed. The basics about photography you should know. If the shutter speed is longer, more light comes on the image, and so it will get much brighter. If the shutter speed is too long, you run in danger to get distortions on your image. To avoid that, you use the tripod. Of course, you have to see the shutter speed dependent to the f-stops. The f-stop defines the radius of the hole to the lens.

For your HDR-Images it´s enough if you make 6 to 8 images. What does this mean for the praxis ? Make your first image, with a very long shutter speed, as instance 10 seconds. You will see, that the image get extrem bright. And you should know, that a good HDR Image has a bride range or even a high range of light information, that gets from bright to dark. So don´t get confused about that, it´s okay. Important are the different shutter speeds and there unit steps between. In the praxis I could see, that it is very good if you have 4 steps between your shutter speed range. As instance, 10 seconds for your first image, and the second shot you make with 4 seconds, and so on.

Take a look on the images which will show you excatly the values

Making your Reference Probes

One very important part is making the reference probes you need later for matching color, contrast and brightness. What exactly are these reference probes, what is the sense and for what do you need these in your 3d application ?

These probes are original shots from your location and your background image you use in the viewport in your 3d software. Therefore you have to recognize, that exactly from your bg-images you have to make the probes. It´s the same like a professional photographer is working on a set. He is measuring the light and tries to get some references about light intensity, light color and contrast. Exactly this is such a very important point to match your 3d objects with your bg image.

Remember, that you will fail to match your 3d scene with your bg image without these very important values. This is the main reason, why many people fail matching 3d objecs with free downloadable hdri´s. Without the probes, it seems to be impossible to match the color and reflection perfect. You will try but without success. But with using your probes, it will be granted that you can match.

If you have made your reference probe, you can load it into your 3d software and put it onto your viewport . In this new scene file, you can create a 3d sphere directly beside the real photographed sphere, the reference probe. Now you have to choose the right angle and camera perspective from your virtual 3d camera. Remember, this has nothing to do with matching colors, it´s only a try to get the right perspective and angle on your virtual 3d camera. So you will get the right setup for your skylight and reflection.

And now it´s time to make your reference probes

These shots are nothig more than your bg images you want to use for your 3d render. But it´s very important, that you put your sphere with your linkage on the photo. I could find out, that it´s very good if the half of your image will use the sphere. Below the images from my probes.

Now let´s start with the first probe, the silver reflection sphere. Now make the setup from your camera, so that you can see your sphere in front of you. Like the images above.

Now use the automatic on your camera, so you will get automaticly the shutter speed and f-stop from your camera. Write down and remember these both values, and switch to your manual modus and set your shutter speed and f-stop to the same value, you´ve got before from your automatic modus.

Now the setup is finished. Get sure that the sphere is sharp in focus and click – make a photo.

Well done, now you have made your first reference probe, in this case your reflective reference probe. Every digital camera will let you know the shutter speed and f-stop from your image you have made. So you can control, if the manual image has the same values like the automatic modus.

Your second reference probe will be the next, and it´s the same way like we did it with the reflective reference probe. But in this case, you don´t use the reflective sphere, you have to use the white one. This sceond probe, is for matching brightness, contrast und saturation as also for the depth of the shadow.

If you want you can make also a probe with a black sphere, or the grey one. Every refernece probe will help your later for color matching. I recommend you to make a grey matte reference probe too. To use white alone, can make you troubles. Your white could be to bright, so that you will get troubles with matching your virtual 3d scene. With the matte grey sphere you will have less risk.

Now you have made your reference probes, but don´t forget to make your bg image without any sphere on it. This will be your bg image in your render scene you want to match with your 3d objects. Get sure, that you photograph your bg image with the same values of shutter speed, f-stop, perspectice, angle and focus.

If you have done all your images and saved on your harddisk, you have finished the part of making your reference probes.

Assembling with HDR Shop

If you have saved your images to your harddisk, open HDR-Shop. Create–> Assemble HDR from Image Sequence

The following image pops up:

Now load every single image into HDR-Shop. Get sure that you only choose the images you have made from your reflection sphere in step 2. In my case, I made 6 images and usually you get a very good result with six images.

Load Images

Camera Responsive Curve: This setting is very important. Choose the right value, the gamma curve from your camera. For the gamma curve you will find many technical papers, and you can get very easily confused. But the gamm-response curve is very simple. If the gamma value is higher, you will get more contrast into your image. But it depends on the gamma curve from your camera, because every camera has different settings. If you are in luck, you will find the gamma curve from your camera in your manual, than you can choose this value.

In my case I have a gama response curve from 1.25. I could also find out, that you will get much better results in rendering, if your HDRI looks like a little bit “washed out”, with less contrast. HDR-Images with a high contrast will bring you big parts of noise, and color distortion, because the contrast is to strong.

Calculate Scale Increments

The software calculates automaticly the scale increments. So it´s not necessary to use your own settings. I always choose the automatic calculation for that. Press “Calculate”, and than “Generate Image”.

Now a new image opens, and you can see your first own generated HDR-Image. Click the middle mouse button, so you can move the image.

With View–> Zoom out / in you can fit the image to your canvas. With + / – you can switch between the different f-stops. Chose the one that will fit best to your real life scene, and click

Image–>Pixels–>Scale to current Exposure

now you have set this f-stop to your favorite one, and this will be used in your 3d software after loading the image.

Select–>Draw Options–>Circle

With that option, we want to select the sphere only. Now click Select–>All. You can see a line which you can select and fit to your sphere. We want to crop the sphere. Image–>Crop

Image–>Panorama–>Panoramic Transformations

Will bring you to the following image:

Here you have two sides. On the left you can see the source image. That is our selfmade reflective sphere. Choose on this side “Mirrored Ball”. Our destination image should be latitude/longitude, that we will load in our 3d software to use it as skylight.

When this is done, Save as–>My_HDRI.hdr and choose a HIGH DYNAMIC RANGE RADIANCE FORMAT.

Congratulations, now you have created your first own HDR-Image.

Matching HDRI – Reflection

Before you start a new max scene file, you have to recognize one thing. You made your own HDR-Image. And this image, we will ned twice in max. Why ? It´s simple, we will need one for our skylight (global illumination) and the other one for the reflection.

With Vray you have the opportunity to use both different channels seperat. For this reason, make a copy of your first hdri, and name both with the following:

a) HDRI-Reflection
b) HDRI – Skylight

Now it´s clear that it´s the same hdri, but with an existing copy of it. Start now your new max scene file.

Very important. At first we match the reflection. For that, open your Material Editor (Shortcut M) and load your HDR Image as Bitmap. You also could load it into a Vray-HDRI, but with the Bitmap you have the Output channel included, that we will need a little bit later.Get sure, that your Bitmap is loaded as spherical environment.

Also check that you have choosen Vray as your render. Before you can make your first test render, we have to make some settings with vray. I don´t make a special explaination for vray, therefore you can use your manual or the offical website of chaosgroup. I will show you in a practical way, how you can get photorealistic result. Deactivate the default lights, and also the hidden lights.

In the environment slot you need to load your hdri reflection only. That´s it. Now it´s time to use your probes in max and create a material, that gives us the same reflective sphere on the image after rendering.

For this, we load our silver reflective sphere, that we have photographed with our bg image into our viewport. Open the Material Editor and load the probe as Bitmap. Get sure, that you load it as Environment and for the mapping type choose Screen.

Now load the first probe into our Environment Slot (shortcut 8).

To see this image in your viewport, you have to make the following settings.

Now we need a reflective material, that will match our chrome sphere after rendering. I used the following settings

Because you have 100% reflection, you have a mirror effect, and you can see the environment from our hdr image. And this reflection we have put into the Reflection channel in the GI Environment. And this reflection again we want to match with the real life reflection we photographed.

To render the reflection perfect from the viewport, you have to position the 3d sphere on the right place. Create a sphere, and rotate your camera (not the sphere) to get the same angle of the image you can see in the viewport. Just try it free. If everyting is set right, the image looks like below.

Add the reflective material to your sphere and click render. Now, you should get the following result.

As you can see, the reflection from our 3d sphere, doesn´t match with the reflection of our bg image. That´s the reason, why we made the probe. Now we want to make some adjustments to match this reflection with the sphere on the bg image.

And now the Output options of our HDR-Bitmap are used to match.

With the three options ammount, rgb offset and rgb level you control the brightness, shadow and color contrast. To get the right reflection, you have to make some changes. If you set the values to the image above, you will get a very nice result. After changing these settings, I´ve made a new render. And now, the 3d sphere looks like the real sphere. You also can edit the values of the color contrast. Click on “Enable Color Map” and try your best. In our example it wasn´t necessary, and we could match it without that edits.

If you would not have the right white balance, and you would have as instance a red touch in your image, than these features are really great to make the changes and try to match as best as you can. Don´t worry if you will not get the best result after seconds, you have to get the right feeling with this feature.

Great, now you have sucessfully matched the reflection.

Matching the HDRI Skylight

Now load your probe with the white sphere as bitmap in your material editor. Change your background image in the viewport, and get sure that you can see your white sphere, instead of the reflective sphere.

Now we want to match the skylight. For this we create a new pure white material. I use a VrayMtl, and choose in the difuse channel pure white with 255/255/255. Now press render, and see your result.

As you can see, our 3d sphere isn´t really white. That´s because we didn´t get our hdr-image in the vray environment slot. Open your render dialog, Vray: Environment and move from your material editor the HDRI-SKYLIGHT to the GI Environment (Skylight) slot.

Your Vray Environment dialog should now look like this:

Okay, now we put the HDRI-SKYLIGHT into the right slot, now render again and you can see that we will get a grey sphere. That means, that we now have light from the skylight, but as you can see, our white color isn´t really white. Our material settings are okay, because we used a pure white. So what´s wrong with it ? The reason why our white sphere is grey, is that the light which comes from our skylight isn´t bright enough. Now it´s time to match this light information with our probe, so that our 3d sphere looks like the white sphere in the background

To match this, we open again our material editor, select the HDRI-SKYLIGHT Bitmap and scroll down to the Output slot. Now pump up the output ammount from 1 to 1.7 and you can see the result below.

As you can see, the result is much better, but really not perfect. Our white from our vray materials doens´t match the white color from the sphere. And if you take a closer look, you can see that on the top of the sphere there is a part of white, but than it falls into grey. And you can see a little bit green touch on the left of the sphere, and that the shadows fall into more red. So, that we can match our white, we need to change the shadow and brightness values, as well as the color map.

I always start from the values I´ve taken from my reflection sphere. In this case I did the same, and I increased the ammount of brightness. Also I made the shadows more red.

The result is now much better and the white from our 3d sphere comes very close to the white from our sphere on the bg image. Of course you can make a 100% perfect white color match, but for this cg study I think it´s really okay. And it should show you, that it is very important to know, that white can be very different, and that you have to match this color information with your reference probe. If you wouldn´t do that, all your 3d objects and there materials wouldn´t fit to the background image.

Now the first step is done, and now you have to do the same with your grey sphere. So you can get sure, that your 3d created shadows, will also match the shadow from your reference probe. And so we can get sure that the shadows in our 3d environemtn will be correct calculated.

But watch out, that you don´t destroy your white color match, because you only have one HDRI-Skylight which you can match.

So you have finished the basic matching steps. With this setup you will have the possibility to fit every 3d object you want to have into your 3d scene, and the colors and shadows, and reflection will match to your bg image. How does the render work, and which tips should you know to get a good render result, I will tell you on the next sides.

Final Render
Now we want to try our final render. (it´snot the name of the render). For this I´ve built a very easy object, a pyramide with spheres. And on the top I´ve used the name of my great father in law, because it´s in his garden.

As you can see, I´ve used a plane for the ground. And I´ve positioned the plane, that it matches to the real ground of the bg image.

Why we use this plane ? Well, we want that our skylight will produce a shadow on the ground, and that´s the reason for.

Important is to know, that the plane should be a matte shadow. That means, that we want that the plane will receive shadows, and also that it will bounces back some rays. Okay, the theory makes sense, but how does it look like in the praxis ?

When you created your plane, select it, right mouse click and choose the Vray Properties. The following dialog will open:

We want to have the plane as matte shadow, so we activate this option. And of course we want to have our shadows, so we click this too.

Our next step is to get sure, that our plane will not have any reflection or refraction. If you wouldn´t deactivate that, every single 3d object would reflect the material from the ground. And in our case we don´t want to have it.

Notice: The light is bouncing back from the plane, so it makes sense to choose a grey color for your plane. With the grey color you can choose the brightness of this light. White would bounce 100% back and black would bring you a very dark result. I recommend to make different tests, and get sure that you know which settings will work best for you.

I think it´s very important to know about these settings. Now it´s your choice, which materials you use for your render. In my case, I´ve used a VrayMtl. I´ve loaded a bitmap texture into my difuse channel, and the same I´ve used monochrom as bump map. In the reflection channel I´ve used a Falloff-Map, from black to grey. Glossy 0.65 and the Index of Reflection (IOR) I set to 1.456.

All other parameters are the defautl settings from the VrayMtl. Here you can see the final render.

Okay, keep in mind, that you want to make some changes after your rendering process. For that you want to have Alpha, Shadow, BG, Depth Map, GI, etc. With theses different passes you can make a lot of changes in Photoshop or even any other graphic program.

You also can save every single image / pass on your harddisk, just use the G-Buffer. Okay, now you have made all your preperation in 3d.

Which images you want to export directly, you can choose in the G-Buffer.

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Scroll to Top