do gamma correction on post if we don't have an sRGB framebuffer
[laserbrain_demo] / sdr / post_gamma.p.glsl
diff --git a/sdr/post_gamma.p.glsl b/sdr/post_gamma.p.glsl
new file mode 100644 (file)
index 0000000..6b323f8
--- /dev/null
@@ -0,0 +1,10 @@
+uniform sampler2D tex;
+
+void main()
+{
+       const vec3 invgamma3 = vec3(1.0 / 2.2);
+       vec3 texel = texture2D(tex, gl_TexCoord[0].st).xyz;
+
+       gl_FragColor.rgb = pow(texel, invgamma3);
+       gl_FragColor.a = 1.0;
+}