|
..::hdri::..
Note
from the author:
This article was written with 3ds max 5 in mind. It should be
noted that later versions of 3ds max contain the ability to use
"native" .hdr filetypes
Contrary
to popular belief, and although it is not covered in the manuals,
3ds max 5 can use HDR images, although not in their native format
(.hdr filetype); they have to be converted to floating-point TIFF’s.
Floating
point TIFF’s have been introduced as a loadable filetype in
version 5. This floating point feature allows a high dynamic range
of luminance values and colour and has now become a standard. Not
only used within 3D applications, it is also widely used in photography,
digital photography and film where image manipulation is required.
Before
the practical, a little theory is necessary. For those who don’t
know, HDR images are used to (relatively) accurately illuminate
a scene based on the “light” from the image. For example,
you could use an image of woodland with the light streaming through
the branches and leaves, or inside a building and illuminate the
scene with it. The end result would look like the synthetic objects
are part of the original image!
So
what’s the difference between a HDR image and a standard photo.
Well, not a great deal. They are shot the same way, but to compile
a HDR image you need to take the same photo several times, each
with different exposures (with each exposure noted). These images
are then combined in a separate program to form one image which
contains all the exposure information. Okay, so it’s a little
more complicated to create a High Dynamic Range image than that,
but these are the basics.
So why do
we need exposure? The amount of exposure determines how much light
is distributed over a scene or in a picture. Therefore, if you took
a photo with a short exposure of the trees with light through the
branches and leaves, you would almost be able to pick out each individual
leaf. With longer exposure the backlight from the sun or sky would
white-out the leaves, leaving a large white splodge. Combining several
images of differing exposures allows us to combine them to create
an image that can be adjusted in exposure in our 3D program. Additionally,
reflections tend to pick out the detail contained within whited-out
areas as reflections are not always a precise mirror; something
you could not do with a single exposed image.
So
how can we capture an environment? The best way is to use a highly
reflective ball (these are available from garden centre outlets
and can be called "mirror balls" or "gazing balls"
and come in a range of sizes). This is positioned exactly where
you want your virtual object(s) to site so the scene’s environment
is captured correctly and will therefore be displayed correctly
in any reflections contained within the 3D object. It also ensures
that any light hitting the surface of the probe will be captured
as the full extents of the sphere will be used. Several photos of
the probe would be taken at different exposures, re-jigged in a
HDRI program, and then unwrapped (if necessary) and exported as
the relevant filetype; in 3ds max’s case a floating point
TIFF.
All this
being said and done, you do not need to create your own HDR image
to use image based lighting in 3ds max, or any other 3D program
capable of doing so. There are a ton of Light Probe images dotting
around the web, which are free to download. These are normally in
the native .hdr format, so they would need to be converted and unwrapped
to be used within 3ds max. However, if you need to drop a 3D object
into a pre-shot scene, you will need to take Light Probe photos
to accurately match the lighting when building the scene in 3ds
max. The Skylight light uses the image as the light source, with
Light Tracer to illuminate the scene and the exposure feature can
control the amount of exposure the entire scene receives. This can
be tweaked and viewed in real-time in the exposure rollout in the
Environment window.
 |
Create
a box 2m x 2m x-0.1m and position it at 0,0,0. If desired, collapse
to an Editable Poly and chamfer the edges to round them off
slightly, else replace the Box Primitive with a ChamferBox Extended
Primitive. |
 |
Create
a Geosphere and place it in the centre of the scene. Offset
it’s position if required so it is just sitting on the
surface of the box. Add any additional objects this way if so
desired, yet the more geometry is added the longer the scene
will take to render. |
 |
In 3ds
max’s standard materials library, assign the Wood_Ashen
material to the box. Set the U and V tiling of the diffuse map
to 3, un-check the bump slot and add a Raytrace map to the reflection
slot. Set the Raytrace map’s spinner value to 20. Check
on Enable Sampler in the SuperSampling rollout. Load the RayTraced_01
material library and assign the ChromeWhite material to the
sphere(s). |
 |
In a new
material, load the kitchen_unwrapped.tif file. Set the Mapping
to Environ – Spherical Environment. Drag the “Bitmap”
button to the same material slot (to just show the map) then
copy the map to another slot. Rename the copied map. Set the
copied map’s Blur offset to 0.1. |
 |
Instance
copy the first map into the Environment Map slot. Select the
perspective Viewport and in the Viewport Background box, check
on Use Environment Background and Display Background. Rotate
the Viewport so no pinching of the map is visible. In Advanced
Lighting, turn on Light Tracer. |
 |
Create
a new Skylight standard light and position it above the scene.
Instance copy the second (blurred) map to the Skylight’s
map slot. In Exposure Control in the Environment window, select
Logarithmic Exposure Control and check on Process Background
and Environment Maps, and Exterior daylight. Set Brightness
and Contrast to 100. |
 |
You've
seen this little fella before, but the model isn't important:
feast your eyes on the light. |
 |
Zip file
to accompany. |
..::tips::..
Creating
light probes is a little more complicated than that - A more detailed
approach can be found at Paul Debevec’s site www.debevec.org
, who is the director of the USC Institute for Creative Technologies.
His HDRShop program can create, manipulate and export HDR images
and floating point TIFF’s – the one used in this example
is from this site, unwrapped and exported using HDRShop
Blurring
the unwrapped Light Probe image assigned to the Skylight list is
necessary to reduce the amount of blotchiness in the resulting render.
If you feel that shadows are not cast accurately enough or there
is too much grain or blotchy patches in non-reflective objects,
try upping the amount of samples and filtering in Light Tracer.
Adding a
bounce or two in Light Tracer will create a slight glow on the table
underneath the chrome balls as the light is reflected off the balls
onto the surface. After rendering an animation, you might notice
a slight flickering of the bounced light. Reduce this by upping
the number of samples and filtering at the expense of render times.
You might also want to amend the Adaptive Undersampling settings.
We used
Logarithmic exposure as it does not change on a frame by frame basis.
Linear and Automatic exposure, although exposure values can be set
which gives a nicer result, are more suited to stills. If these
exposure types are used on animations, flickering can occur as the
scene moves or objects move on and off camera and the set exposure
tries to compensate.
Initially
published: 3D
World magazine, Issue 33, December 2002.
Copyright
© Pete
Draper, December 2002. Reproduction without permission
prohibited.
www.xenomorphic.co.uk |