tonemapper doing weird things

Hi,

after getting the tonemapper finally running (see other thread) I struggle to grasp what it is doing. Even if exposure and gamma are set to 1.0f it modifies the image. You can test that in the denoiser example from the sdk. Line 546 and 547. Just set exposure and gamma to 1.0f. Or comment the lines.
I would expect it to not change the “original” image, but it does get darker here.

I’m also unable to invert the tonemapping. One stage with gamma and a following stage with 1/gamma does not result in the orginal image.

Is this a bug?

Cheers,
Nico

According to the documentation it simply does this:
[url]http://raytracing-docs.nvidia.com/optix/guide/index.html#post_processing_framework#6151[/url]

A renderer normally works in linear color space, while displays and the human eye don’t.
When setting gamma and exposure to 1.0, you get the linear colors of the HDR image.

The colors in the range [0.0, 1.0] get brighter when increasing the gamma value.
See some examples here: [url]https://en.wikipedia.org/wiki/Gamma_correction[/url]

But according to the docs setting both to 1.0f shouldn’t do anything. pow(value * 1.0f, 1.0f) is value again.
That would mean inputbuffer == outputbuffer. But the output is darker, so something must happen.

I’ve confirmed what you’re experiencing and the reason is that the TonemapperSimple is a three stage implementation of exposure, tonemapping, and gamma.
Means even if the exposure and gamma values are set to default values, the tonemapper step is still applied and it’s inspired by what analog films or real-time games, for that matter, do to preserve a natural look as much as possible.

The documentation touches on that by saying that the stage does tonemapping and gamma correction. That explanation is going to be clarified in the future. Sorry for the confusion.

If you don’t want that tonemapping step to be applied you can simply roll your own small ray generation program which implements the necessary operations and add these custom stages to the post-processing command list with appendLaunch().