Clamp pre-bloom color to valid range (#15453)

That avoids flashing artifacts when combining MSAA and bloom.
This commit is contained in:
lhofhansl 2024-11-25 11:56:32 -08:00 committed by GitHub
parent b77ad82fb9
commit 8c56434bd3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -23,7 +23,7 @@ void main(void)
vec2 uv = varTexCoord.st; vec2 uv = varTexCoord.st;
vec3 color = texture2D(rendered, uv).rgb; vec3 color = texture2D(rendered, uv).rgb;
// translate to linear colorspace (approximate) // translate to linear colorspace (approximate)
color = pow(color, vec3(2.2)); color = pow(clamp(color, 0.0, 1.0), vec3(2.2));
color *= exposureParams.compensationFactor * bloomStrength; color *= exposureParams.compensationFactor * bloomStrength;