knightcrawler25 / GLSL-PathTracer

A toy physically based GPU path tracer (C++/OpenGL/GLSL)
MIT License
1.87k stars 176 forks source link

Added ACES tonemapping #56

Closed Nolram12345 closed 3 years ago

Nolram12345 commented 3 years ago

Added a quick, simple implementation of ACES tonemapping from back my fork of this renderer as I thought it could be useful as a more general feature here as well. The fork adds support for (simulated) ACES tonemapping, resulting in higher contrast and perceived dynamic range and more vibrant colors, and a switch to enable and disable this tonemapping at runtime.

knightcrawler25 commented 3 years ago

Thanks for this! I'll add this in.

I compared the results against ACES in Cycles and it looks like the simple fit over saturates bright values as described here: https://knarkowicz.wordpress.com/2016/01/06/aces-filmic-tone-mapping-curve/. The article also describes a better fit, which I tried, and here are the results:

Rendered with Cycles & ACES: ACES - Cycles

Rendered with this repo and the complex fit: ACES - GLSL

Results from this PR: ACES(Sim) - GLSL

knightcrawler25 commented 3 years ago

I added the other fit as well to the repo. Also, since the tone mapping is done at the end, I modified your code slightly so that the options are sent to the tonemap shader as uniforms. This way the tone mapper can be enabled/disabled without re-starting the render. Thanks again!