1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-01 17:38:41 +00:00

Fix no color values on bloom texture (#13197)

Align meaning of 'exposure' variable across different stages
Put 'exposure' variable behind ENABLE_AUTO_EXPOSURE
This commit is contained in:
x2048 2023-02-10 21:04:37 +01:00 committed by GitHub
parent d3a6ee00e6
commit 4cd6b773bb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 29 additions and 9 deletions

View file

@ -14,7 +14,9 @@ varying mediump vec2 varTexCoord;
centroid varying vec2 varTexCoord;
#endif
varying float exposure;
#ifdef ENABLE_AUTO_EXPOSURE
varying float exposure; // linear exposure factor, see vertex shader
#endif
void main(void)
{
@ -23,6 +25,11 @@ void main(void)
// translate to linear colorspace (approximate)
color = pow(color, vec3(2.2));
color *= pow(2., exposure) * exposureParams.compensationFactor * bloomStrength;
color *= exposureParams.compensationFactor * bloomStrength;
#ifdef ENABLE_AUTO_EXPOSURE
color *= exposure;
#endif
gl_FragColor = vec4(color, 1.0); // force full alpha to avoid holes in the image.
}