fixed bad hdr and bloom too strong

This commit is contained in:
Anselme 2016-01-10 18:53:18 +01:00
parent 698ce5b62a
commit fb8ff13751
2 changed files with 3 additions and 4 deletions

View File

@ -21,7 +21,6 @@ void main(void) {
bloom += texture(blurSampler2, gl_FragCoord.xy/4).xyz;
bloom += texture(blurSampler3, gl_FragCoord.xy/8).xyz;
color += bloom;
outColor = vec4(color + bloom*0.02f, 1.0);
outColor = vec4(color + bloom/4, 1.0);
minMaxMean = vec3(0.2126*color.r + 0.7152*color.g + 0.0722*color.b);
}

View File

@ -11,9 +11,9 @@ void main(void) {
ivec2 pos = ivec2(gl_FragCoord.xy);
vec3 color = texelFetch(colorSampler, pos).xyz;
vec3 mapped = (color-minMaxMean.r)/(minMaxMean.g-minMaxMean.r);
//vec3 mapped = (color-minMaxMean.r)/(minMaxMean.g-minMaxMean.r);
// Exposure tone mapping
//vec3 mapped = vec3(1.0) - exp(-color * exposition);
vec3 mapped = vec3(1.0) - exp(-color * 0.5/minMaxMean.b);
// Gamma correction
mapped = pow(mapped, vec3(1.0 / gamma));