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:
parent
d3a6ee00e6
commit
4cd6b773bb
4 changed files with 29 additions and 9 deletions
|
@ -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.
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue