Adjust scene HDR lighting with intensity vs exposure

Hey folks,

If I want increase the brightness of a given scene. The only light source in the scene is coming from a HDR file. Should adjust the intensity of the HDR or the exposure in image process?

Which is a better way technically?

Many thanks,
Tawibox

I don’t know which one’s best ‘technically’. I’m not so much of a technical person.
I can tell you how I did it in my ‘space museum’ demo. Visually, I wasn’t satisfied using exposure (or image processing). Problem was the scene is very dark (in space) but is displaying paintings. I wanted to make sure to keep with the white and black point of these paintings when making the scene brighter. Didn’t want to make them unlit because I still wanted them to catch a tiny part of the env. Same as you (except for some spotlights) the scene catches light only from the HDR env(s).
So what I did is the following: I created a few clones of the env texture (5). I apply either to the desired material(s). Next, I use levels on these env clones to adjust brightness. On these specific paintings, I also adjust the albedoColor (white point) to become light grey when pushing the scene ‘brightness’ beyond a certain point (to make sure the white point is not ‘exploded’).

1 Like

Hello :slight_smile:

I’ll give a general “3D rendering” answer, regardless of BabylonJS itself :
I highly recommand to adjust the intensity of the HDR instead of image process, for precision reasons :

  • HDR can be of various format, but uses to be floating-point values (in 16, 32, 48, or even 64 bits, most common being 32 bits)
  • Image Processing runs after render, on 8 bits values (0-255) of each RGB channel.

A good way of understanding the difference (in term of final result) is to imagine the edge case where a part of the render is dark for example (final 8 bits value == 0).

  • If you use image processing, you will only add some fake lighting on this part (all the dark pixels will now be at a higher value, let’s say for example 20, but without any variation.
  • If you enhance HDR intensity, since it’s float, you will add non only light, but as well some details (which was hidden in the floating point low values, and cropped to 0). Result on the final render will be that arround the new values 20 you will have a full range (let’s say from 15 to 25) due to the details of the HDR lighting which was retrieved when scaling up this float value.
  • Basically final render will be better quality, by taking advantage of HDR details.

On the general artistic point of view, (same with photography or movie making) it’s always better to tweak your colors as “early” as possible in the process, with high precision. That way you avoid to deal with too few different colors, which can lead to visible artifact on the final image.

4 Likes

Thanks for all the answers folks!!
These are make sense to me and looks intensity is the right way to go no matter what.

Appreciate it everyone :slight_smile:
Tawibox

WoW. I can sense the expert here and I can only be admirative of the effort you are putting into explaining and teaching us. I think I’m gonna start bookmark your posts in the same way I do it with Patrick posts :grin: :smiling_face_with_three_hearts:

Well…again, I’m essentially a 2D designer at the base. Came to 3D only later. The thing I find with using ‘intensity’ only (VS intensity + levels) is that pushing ‘intensity’ kind of simply pushes the entire spectrum (similar to using curves in linear and/or exposure). As much as I do of course use ‘intensity’ as a base, I also often want to combine it with working the ‘levels’ - and often, per material type (depending on whether I want a more ‘washed out’ or more ‘strong/dynamic/bright’ reflection.

1 Like