Implementing HDR light adaptation
In the previous recipe, Implementing HDR rendering and tone mapping, we learned how to do the basic stages of an HDR pipeline. Let's extend this and add a realistic light-adaptation process to simulate how the human-vision system adapts to bright light.
Getting ready
Make sure you go through the previous recipe, Implementing HDR rendering and tone mapping, before taking on this one.
The source code for this demo is located at Chapter8/GL04_HDR_Adaptation
.
How to do it...
In order to add a light-adaptation step to our previous HDR tone-mapping demo, let's introduce a few additions to the C++ code:
- First, we need a new parameter to control the light-adaptation speed:
struct HDRParams { Â Â float exposure_ = 0.9f; Â Â float maxWhite_ = 1.17f; Â Â float bloomStrength_ = 1.1f; Â Â float adaptationSpeed_ = 0.1f; } g_HDRParams; static_assert(Â Â sizeof(HDRParams) <= sizeof(PerFrameData...