fix exposure settings on output

This commit is contained in:
Edgaru089 2022-03-06 12:36:21 +08:00
parent 5d4acbfc43
commit 5f66b792c7

View File

@ -11,5 +11,11 @@ void main() {
if (texColor.a < 1e-4)
discard;
outputColor = vec4(pow(texColor.rgb * exposure, vec3(1.0/gamma)), 1.0f);
vec3 mapped = texColor.rgb;
if (exposure < 1e-4)
mapped = mapped / (mapped + vec3(1.0));
else
mapped = vec3(1.0) - exp(-mapped * exposure);
outputColor = vec4(pow(mapped, vec3(1.0/gamma)), 1.0f);
}