
3D Graphics Rendering Cookbook
By :

Just recently, in the previous recipe, we learned how to implement one OpenGL postprocessing effect in Vulkan, and here, we will learn how to implement HDR rendering and tone mapping using the Vulkan API.
Make sure you read the Implementing HDR rendering and tone mapping recipe to understand the HDR rendering pipeline, and the Writing postprocessing effects in Vulkan recipe to have a good grasp of the basic classes we use in our Vulkan postprocessors.
The complete source code for this recipe can be found in Chapter8/VK03_HDR
.
We define an HDRPostprocessor
class derived from QuadProcessor
that performs a per-pixel tone-mapping operation on an input framebuffer. The tone-mapping parameter pointers can be tweaked by the application code in the UI window.
One C++-related subtlety must be addressed in the initialization of the HDRProstprocessor
class: