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.

35 Comments

  1. I cannot find your email address anywhere. Our company are looking for a partner in Germany to target a particular market which I am pretty sure would be of interest, could you email me at the address given so I can fill you in with more details.

    Many thanks,
    Steve

  2. Very interesting tip… I’m actually creating some of my own HDRi’s and i can test this trick of yours in my preview scenes.

  3. BBB3VIZ wrote:

    Hey Ronen. I hope it can be useful. Remember you don’t have to use a 0.5 gamma. You can also test anything between 0.5 and 1 as some values may work better on some maps. Really looking forward to your tests.

  4. Shahrokh wrote:

    Thanks for the tip Bertrand, the blog also looks neat and inviting to me. I have the impression that I will learn things and enjoy my time in here.

  5. BBB3VIZ wrote:

    Thanks a lot for dropping by.

  6. Martijn wrote:

    I am wondering if you take on any freelance work. I am starting a company in Montreal, aren’t you in Montreal as well? If so, I wouldn’t mind taking you out for a beer to discuss how we could work together.

    Drop me a line!

  7. BBB3VIZ wrote:

    Grand merci, Martijn. Very much appreciated. Unfortunately, I’m not available for freelance work right now. But I’d happily take you up on your offer next time I’m in the wonderful (though chilly) city of Montreal.

  8. Brett Simms wrote:

    Cool tip – I’ll have to try that. Thanks for sharing.
    b

  9. liberado wrote:

    sorry for my english

    peter guthrie use vraylight DOME with hdri texture; vrayhdri not control UVW mapping.

    and you, what used?

    good blog

    thx

  10. BBB3VIZ wrote:

    Hi Liberado,
    I also use a Dome light. Much better than the environment.
    I tend to use the VrayHDRI map if I can because it has both a handy rotate tool and a gamma dial, which I use a lot. I don’t mind the lack of vertical rotation as I always use complete spherical HDRs.
    Whenever I use one of Peter’s maps, I convert it to HDR first.

  11. liberado wrote:

    thanks for your answer, very clear

    How do you create your hdr?; Open the jpg in PS and saved as hdr?; I mean the control of dynamic range. Or not do anything in PS; beyond the saturation control etc etc.

  12. BBB3VIZ wrote:

    Well, you need an hdr file to start with. You can make a jpg (8 bits) out of an hdr (32 bits), but not the opposite. It would require data that is just not there in the much smaller jpg. Your best bet right now is to buy one of Peter Guthrie’s skies and either use it as it is (as an .exr) in 3ds Max’s bitmap loader, or convert it to .hdr in PShop first and use it in a VrayHdri map. They’re big enough to be used as backplates too.

  13. Luis wrote:

    An a-ha moment!! thanks!

  14. BBB3VIZ wrote:

    No problem Luis. Glad if you find it useful.

  15. ariano wrote:

    Hey bertrand, maybe you know my boss Justus Etemeyer from eve-images (berlin). I have to say, you do pretty amazing stuffs!
    I also use Peters method. Cool to ear from your workaround for sharper shadows, i will test it right away.
    The thing is, what i am doing is seting the Light Dome to invisible and using the same VrayHDRI also in the enviroment slot. What i get is control over sky (background) and over GI (light dome).
    Tell me what you think…im still figuring things out.

    Machs gut, gruesse aus berlin.

  16. BBB3VIZ wrote:

    Hi Ariano,
    Sorry for the long delay in replying. Indeed, I know your boss. Send him my best regards.
    I use the same methode as you do when the gamma hack spoils my HDR backplate. In such a case, it’s better to keep two different copies of the image with different gamma values. Sometimes you may have to use the non modified map in the reflection slot too.

  17. BBB3Viz wrote:

    Hey,

    The correct way of getting shadows from a hdri is to insert the map into a vray dome light. Don’t adjust the resolution option under the light parameters, only the subdiv’s. Usually 30subdiv’s works well.
    Using this method you should be beable to light even interiors.

    I was taught this method during a training session by Chaosgroup.

    Regards

    Alex

  18. BBB3VIZ wrote:

    Thanks Alex. Apologies if I wasn’t clear on this. This tuto assumes that you’re using the Vray Dome Light since it alone does importance sampling.

  19. Reynhardt wrote:

    Hi There
    I was just wondering….when I use the dome light as you say it causes a lot of noise especially in the shadow areas (it doesn’t make a big difference if I up the subdivisions.) Is there any way to avoid this.
    Thanks
    R

  20. BBB3VIZ wrote:

    This can be related to the complexity of the scene. But in most cases, lowering the noise threshold in the Vray settings will sort it out (to something like 0.05 or 0.03). You can also raise the Brute Force subdivs if using this GI Method, or raise your DMC settings. All these will of course increase render time.

  21. kropped wrote:

    Another great tip – thanks again

  22. Daniel Dolan wrote:

    Hello:

    I am an Architect in Chicago and I discovered your images of the Ando House in Chicago.

    At the risk of offending….may I ask if you ever create commissioned work?

    Many specialists in your field, I understand are more interested in non-architectural subjects which is why your work is so unique.

    I have an unbuilt residence, designed for a client friend which is pending construction.

    In any case I would be very interested to talk with you further at your convenience.

    Best regards,

    D/D

  23. [...] that all images were lit only with HDR maps, plugged into a Vray Dome Light and Gamma-tweaked using my HDR workflow in order to obtain sharper shadows. There are no other lights present in the scene. Another bit [...]

  24. George wrote:

    Hi Bertrand,
    I tried to change the gamma of Peters EXR map. But some how it does not change anything. Where did you change the gamma?
    Regards
    George

  25. BBB3VIZ wrote:

    Hi George,
    There is an option to change the gamme in the VrayHDRI-loader. That’s the one I use (and successfully with Peter’s maps too).

  26. [...] slots, Marcel recommends using a more refined version of the HDR workflow I highlighted in this post last year. This involves using the gamma control of the VrayHDR texture map to modulate the [...]

  27. Robert P wrote:

    Bertrand,

    In your post you mention that this method will artificially boost your light source. I think the problem of washed out lights from HDRI’s is a problem caused by 3dsmax. Maybe 3dsmax also gives the hdri the 2,2 correction it gives bitmaps in order to work in a LWF. The problem that occurs is that a 32 bit HDRI doesn’t need this conversion because it’s already lineair. So by lowering the HDRI’s gamma you are actually correcting this mistake. Do you think this could be the case?

    regards,

    Rob

  28. BBB3VIZ wrote:

    Hi Robert, thanks for the insight. I’m not sure this is the case, actually, though it appears to work that way at least using some specific map that would otherwise appear very faint in the render. However most of the time, using the Gamma HDR workflow results in the maps looking too contrasted in the environment and reflection slots, hence Marcel’s suggestion of using two separate DomeLights: one for lighting and the other for reflection, environment and refraction – but with the lighting turned off.

  29. [...] slots, Marcel recommends using a more refined version of the HDR workflow I highlighted in this post last year. This involves using the gamma control of the VrayHDR texture map to modulate the [...]

  30. [...] peterguthrie.netПоследовав совету, впервые увиденному мной в блоге Бертрана Бенуа, я адаптировал под себя новый метод загрузки HDRi неба. [...]

  31. PBX wrote:

    Thx for the tips and advice in the comments!

  32. [...] that all images were lit only with HDR maps, plugged into a Vray Dome Light and Gamma-tweaked using my HDR workflow in order to obtain sharper shadows. There are no other lights present in the [...]

  33. [...] for the HDRI light and Environment Background Image slots. I was brought to this idea by Bertrand Benoit and Peter Guthrie who describe how lowering HDRI (and other imagery) Gamma enhances contrast and [...]

  34. George wrote:

    Hey Bertrand,
    It seems to work very nice with exteriors. But with interior with a lot of detail, I have to set my Brute force sub. to 250 to stop the noise. I think this is extremely high. what do you think
    Regards
    George

  35. BBB3VIZ wrote:

    Hi George. That’s a problem with the light dome in general, not with the gamma of the hdr. It is solved through higher subdivision or by reducing the intensity.