On HDR lighting
There have been many lively discussions recently about how best to use HDR images for lighting in 3dsMax and Vray. The latest round came after the release of Peter Guthrie’s excellent HDR sky images. Time for me to add my two cents on the subject.
One recurring question is how to obtain sharp shadows that match the photos used to create the HDR map. Often times, sunny-sky HDR images, for instance, only seem to yield renders with big, blurry soft shadows instead of the sharp shadows you’d expect from looking at the map. This is especially obvious when working in LWF or with particularly washed out HDR maps.
There are traditional workarounds for this. One consists in adding a VraySun or a direct light to the scene and align them with the sun in the HDR image. Another is to use the “Smart IBL” system, which does exactly the same thing but automates the process.
But there’s another, simpler way to obtain sharp shadows from nearly all HDR maps – shadows that are 100 per cent consistent with the map, authentic-looking, and do not involve adding any other light sources. Most of the time, lowering a map’s gamma will do the trick. Yep, that’s it. What this hack does is to increase the contrast of the HDR image, thereby artificially boosting its dynamic range. It is most effective when using maps that have a reasonably high dynamic range, strong and well-defined light sources (spotlights, a sun, etc.), and sufficient resolution. It also helps if you’re using an accurate rendering methode for GI – using a very low-res irradiance map will make it more difficult to generate sharp shadows than using brute force sampling.
The image below shows this trick in action using four home-made, very high-resolution HDR maps. The renders on the left use the maps with their default gamma of 1.0. On the right, the gamma was lowered to 0.5. Look at the difference in shadow definition and general “punchiness” (click for higher resolution). The easiest way to do this is to use .hdr images in a VrayHDRI map, which features a live gamma control.
You can find the high-res maps used for this example in my Turbosquid account.
In all cases, render times were similar and none of the images were post-produced. Of course, the technique has drawbacks. Changing a map’s gamma may change the light’s intensity, it may alter a map’s colours in a way that makes it difficult to use the map as a backplate, it may create unnatural reflections… If you use very high-dynamic range, high-resolution images, you may get sharp shadows out of the box with a gamma of 1. In other situations, the gamma treatment may happen to be precisely what the doctor had ordered to compensate for an LWF image’s washed-out appearance. In other words, it all depends on the situation. But when all you’re getting are soft shadows and you want them sharp, this one is worth a try.