C++ cross-platform 3D graphics SDK. Includes demos & helper code (resource loading etc.) to speed up development of Vulkan, OpenGL ES 2.0 & 3.x applications
I see that in the vulkan postfragment Fragshader, when calculating the oFilter you are doing log2 and exp2 for each fragments/frame. Instead calculate the final exposure value in the CPU and pass it to the push constant(Save GPU cycle).
Therefore we only recalculate the "exposure" value when we need to when the user input changes in the application.
I see that in the vulkan postfragment Fragshader, when calculating the oFilter you are doing log2 and exp2 for each fragments/frame. Instead calculate the final exposure value in the CPU and pass it to the push constant(Save GPU cycle). Therefore we only recalculate the "exposure" value when we need to when the user input changes in the application.
OLD VERSION
SIMPLER & OPTIMISED VERSION
https://github.com/powervr-graphics/Native_SDK/blob/master/examples/Vulkan/PostProcessing/FragShader.fsh
HOPE IT HELPS. MERRY CHRISTMAS.