]> git.lizzy.rs Git - minetest.git/blobdiff - client/shaders/second_stage/opengl_vertex.glsl
Fix no color values on bloom texture (#13197)
[minetest.git] / client / shaders / second_stage / opengl_vertex.glsl
index 7c121f6d123b034a43e4b7d96b3a2fccc828bcdd..f74960ec2b4c3227e0adb33ff0dfcba7d980db56 100644 (file)
@@ -1,22 +1,23 @@
+#ifdef ENABLE_AUTO_EXPOSURE
 #define exposureMap texture2
 
 uniform sampler2D exposureMap;
 
+varying float exposure;
+#endif
+
 #ifdef GL_ES
 varying mediump vec2 varTexCoord;
 #else
 centroid varying vec2 varTexCoord;
 #endif
 
-varying float exposure;
-
 void main(void)
 {
 #ifdef ENABLE_AUTO_EXPOSURE
+       // value in the texture is on a logarithtmic scale
        exposure = texture2D(exposureMap, vec2(0.5)).r;
        exposure = pow(2., exposure);
-#else
-       exposure = 1.0;
 #endif
 
        varTexCoord.st = inTexCoord0.st;