On tone mapping and saturation

FoxMcCloud

Newcomer
There's something I can't agree with regarding tone mapping: why are we doing the bright-pass before tone mapping, and why do we tone map to the range [0, 1] instead of [0, N] (N > 1)? I've been playing around with that and I think the two are closely related.

I'll be using the term "bright-pass" to refer to the rendering pass where the bright parts of the HDR framebuffer are put in a separate texture (which is usually used later for effects like bloom)

Tonemapping operators like Exponential and Hable's Filmic map to [0, 1], so a bright-pass afterwards will lose a lot of the dynamic range. A bright pass before tone mapping maintains that, but it doesn't adapt properly to the scene IMO. If I have a very dark scene with color intensities ranging from [0, 0.3], say, I'd ideally tone map to expand those values into a wide range depending on the scene's brightness, and thus if the scene consists of a moderately bright spot in complete darkness it should receive some bloom too.

I think the fact that we're used to tone-mapping to [0,1] is restrictive here. What I did (and keep in mind that's just me fooling around - I'm not saying that it's The Right Thing but I'm soliciting opinions) was to come up with some sort of non-saturating tone-mapping operator that closely matches exponential for the most part in the [0, 1] region. The formula is:

((x + 1.0)^Exposure - 1.0) * OverallScale

Here's a picture of its graph:

http://www.flickr.com/photos/59098813@N06/6324153284/

I'm using this to map from [0, FP16_MAX] to [0, N] where N is > 1. Then I perform the bright-pass *AFTER* tone mapping where each pixel in the bright-pass texture is equal to Original - 1.0. Dynamic range is preserved and this way a bright point in a very dark scene still makes it into the bright-pass texture for bloom and post-processing. Thoughts?
 
Last edited by a moderator:
Hable's curve is not restricted to [0,1]. It has a white point parameter that controls how higher values burn out. If you set it to 1.0 and also manipulate a few other parameters, you can basically get an unclamped linear curve for brighter values. Reinhard's curve is also like that, where you set a white point. But the reason why most curves do aim for [0, 1] is because that's your displayable range. So if you don't end up with a value <= 1, then it's just going to get clamped anyway. However if your curve does limit you at 1.0, then you can put a nice shoulder in you curve that rounds off the brights rather than slamming them with a clamp.

Anyway what I like to do for bloom is during the downsample (which is before tone mapping), I hit it with a similar tone mapping curve but a different exposure value. This effectively gives you only the bright spots, and if you want you can use different parameters for your curve that allow the values to blow out more. I have no idea if this is common, but I'm sure at least a few people do it this way. You can also just not use a curve at all and just use a different exposure.
 
Last edited by a moderator:
Thanks, that clears some things up. Using the tone-mapping operator for bloom actually makes a ton of sense. Why do people usually apply the bloom filter / bright-pass before tone-mapping? It seems so obviously wrong.
 
Back
Top