Blender 3D: Noob to Pro/HDRi

From Wikibooks, open books for an open world
Jump to: navigation, search

Introduction[edit]

You may have heard various people talk about HDR images. (WETA, Lucas, even Tim Sweeny). HDR images are part of a technology called HDRi which stands for "High Dynamic Range (image)". So... what on earth does that mean?

Here's a link to Wikipedia's article on the HDR format which I personally give all my credit to Paul Debevec for putting it to use for computer graphics purposes. Anyway, before you start trying to understand the usefulness of HDRi, please read the wikipedia link.

Also, visit Paul Debevec's website if you've got some more time to spare.

To sum up the excitement of HDR CG, think of it like the hype of the next-generation videogames that are about to come out, except set the stage for 1996 instead of 2006. Paul Debevec pioneered paralax mapping, HDR lighting, image-based modeling, his latest work includes some even more amazing technologies, and for the record he's my hero too.

To use HDRi images for 3D rendering, you need something called a light probe...

Definitions[edit]

HDRI
HDR image file example

HDRI stands for High Dynamic Range Imaging, and is basically an image format that contains from the deepest shadow up to the brightest highlight information. While an 'ordinary' digital image contains only 8 bits of information per color (red, green, blue) which gives you 256 gradations per color, the HDR image format stores the 3 colors with floating point accuracy. Thus the 'depth' from dark to light per color is virtually unlimited. Using HDR images in a 3D environment will result in very realistic and convincing shadows, highlights and reflections. This is very important for realistic emulation of chrome for example.

Light Probe

A Light Probe is a HDR image containing 360 by 360 degrees (solid anglesteradians) image information. In other words : it's a 360 degree spherical panorama image, not only looking around the horizon, but also up and down. Thus a Light Probe image contains all visible information as can be seen from a specific point, wherever you turn your head.

Usage[edit]

Given that a Light Probe image is an 'all around' image with a high dynamic range, it's the perfect solution for your 'world' background, especially for a 3D animation.

Quick Tutorial (for experienced blendies)[edit]

First of all, you'll need an HDR image. There is a whole range at http://debevec.org/Probes/ that you can download for free. (There are even more at http://blenderartists.org/forum/showthread.php?t=24038 ). I will use the St. Peter's Basilica probe, but any other HDR image will do just fine.

To apply the HDRI environment to your scene:

  • Go to the shading settings (press F5) and click the World button.
  • Enable "Real" to force the horizon to stay still, as opposed to follow the camera
  • If you're rendering with Blender Internal (ver. 2.49), go to "Ambient Occlusion" tab and activate "Ambient Occlusion", then activate "Sky Texture". Skip this step if you're using external renderers.
  • In the "Texture and Input" tab, click "Add New" and "Angmap".
  • Then go to the "Map To" tab and deactivate "Blend" and activate "Hori".
  • Now go to the Texture settings (press F6) and change the "Texture Type" to "Image".
  • Click the "Load Image" button and locate your HDR image.
  • If you're using YafRay or other external renderers, you need to turn on Global Illumination and to set the quality to something other than "none".

Step-by-step Tutorial[edit]

Build a simple scene[edit]

To see the advantage of using a 360 by 360 world image, the simplest example to demonstrate this is a scene with a mirrored sphere.

Scene
  1. Add a sphere and a cube to your scene and place them in a bit of an interesting position. (note that I added a second lamp to light up the shadow part of the cube)
  2. Perhaps give the cube a different color than the default grey.
Material setting for a mirror surface and a preview of it
  1. Give the sphere a mirrored material : go to the Shading -> Material panel (F5) and find the Mirror Trans buttons.
  2. Check that Ray Mirror button is pressed. If it is not, check it.
  3. Set the RayMir value to a value of 0.5 or higher. Your preview should show the reflection of the checkboard environment.

Render with HDR (Blender Internal v2.49)[edit]

  1. Download a HDR image (see Paul Debevec's website)
  2. Go to the shading settings (press F5) and click the World button.
AngMap enabled
  1. Go to "Ambient Occlusion" tab and activate "Ambient Occlusion", then make sure "Raytrace" is chosen as gather method, and activate "Sky Texture"
  2. Adjust quality settings:
    1. Increasing number of samples reduces noise, but increases render times
    2. Adaptive QMC is faster, but generates more noise than Constant QMC
  3. In the "Texture and Input" tab, click "Add New" and "Angmap"
  4. Then go to the "Map To" tab and deactivate "Blend" and activate "Hori".
  5. Now go to the Texture settings (press F6) and change the "Texture Type" to "Image".
  6. Click the "Load Image" button and locate your HDR image.

Render with YafRay[edit]

  1. Download a HDR image (see Paul Debevec's website).
  2. Go to the shading settings (press F5) and click the World button.
  3. In the "Texture and Input" tab, click "Add New" and "Angmap". Note that the Angmap button is the important thing to tell Blender that this file is a Light Probe file !
  4. Then go to the "Map To" tab and deactivate "Blend" and activate "Hori".
  5. Now go to the Texture settings (press F6) and change the "Texture Type" to "Image".
  6. Click the "Load Image" button and locate your HDR image.

(optional step, as it was not needed for my setup :)

5. Press F10 and change the "Blender Internal" to "YafRay". You need to turn on Global Illumination and to set the quality to something other than "none". Note that the YafRay renderer does not come standard with the Blender installation. You need to download and install this separately.

Your result should look like this: (Rendering: left with Blender, right with YafRay) Click for larger version
Blender HDR Result.jpgBlender HDR YafRay Result.jpg
Note that the reflecting ball reflects the whole interior from every angle, even though we added just a single image to the World settings !