Using formula from an article suggested by samuncle

This commit is contained in:
vlj 2014-03-31 00:36:23 +02:00 committed by Vincent Lejeune
parent af93a04987
commit 251e7f669e

View File

@ -233,8 +233,9 @@ void main()
avgLuminance = exp(avgLuminance) - delta;
vec3 Yxy = getCIEYxy(col.xyz);
float Lp = Yxy.r * exposure / avgLuminance;
Yxy.r = (Lp * (1. * Lp / (whitePoint * whitePoint))) / (1. + Lp);
float a = max(0, 1.5 - 1.5 / (avgLuminance * .1 + 1)) + .1;
float Lp = Yxy.r * a / avgLuminance;
Yxy.r = Lp;//(Lp * (1. * Lp / (whitePoint * whitePoint))) / (1. + Lp);
col.xyz = getRGBFromCIEXxy(Yxy);
float curdepth = texture(dtex, uv).x;