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...