Commit 353b6908 authored by Steve Lhomme's avatar Steve Lhomme Committed by Hugo Beauzée-Luyssen

direct3d11: simplify the tone mapping algo

Do the 3 values in one pass. This allow doing tone mapping even on 9.1
compatible GPUs which have a restricted number of instructions/slots.

(cherry picked from commit cc074043)
Signed-off-by: default avatarHugo Beauzée-Luyssen <hugo@beauzee.fr>
parent 88ff1308
......@@ -329,18 +329,11 @@ static const char* globPixelShaderDefault = "\
};\
\
/* see http://filmicworlds.com/blog/filmic-tonemapping-operators/ */\
inline float hable(float x) {\
inline float3 hable(float3 x) {\
const float A = 0.15, B = 0.50, C = 0.10, D = 0.20, E = 0.02, F = 0.30;\
return ((x * (A*x + (C*B))+(D*E))/(x * (A*x + B) + (D*F))) - E/F;\
}\
\
inline float3 hable(float3 x) {\
x.r = hable(x.r);\
x.g = hable(x.g);\
x.b = hable(x.b);\
return x;\
}\
\
/* https://en.wikipedia.org/wiki/Hybrid_Log-Gamma#Technical_details */\
inline float inverse_HLG(float x){\
const float B67_a = 0.17883277;\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment