git-svn-id: svn://db.shs.com.ru/libs@586 a8b55f48-bf90-11e4-a774-851b48703e85

This commit is contained in:
2019-09-02 14:08:38 +00:00
parent f862381b68
commit 3d06d2095e
929 changed files with 66799 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
#version 150
uniform sampler2D t0;
uniform float exposure;
float tA = 0.15;
float tB = 0.50;
float tC = 0.10;
float tD = 0.20;
float tE = 0.02;
float tF = 0.30;
float tW = 11.2;
vec3 Uncharted2Tonemap(vec3 x) {
return ((x*(tA*x+tC*tB)+tD*tE)/(x*(tA*x+tB)+tD*tF))-tE/tF;
}
void main(void) {
//qgl_FragData[0].rgb = texelFetch(t0, ivec2(gl_FragCoord.xy), 0).rgb;
//return;
vec3 inColor = texelFetch(t0, ivec2(gl_FragCoord.xy), 0).rgb;
inColor *= exposure / 1.45;
float ExposureBias = 1.;
vec3 curr = Uncharted2Tonemap(ExposureBias*inColor);
vec3 whiteScale = 1. / Uncharted2Tonemap(vec3(tW));
vec3 color = curr * whiteScale;
vec3 retColor = color;//pow(color, vec3(1 / 1));
qgl_FragData[0].rgb = retColor;
}