dungeon_crawler

view prototype/sdr/post.p.glsl @ 79:110b2af4b9d8

fixed the shader non-conformity by explicitly converting 2.2 to vec3 before passing it to pow for the texel inverse-gamma thing
author John Tsiombikas <nuclear@member.fsf.org>
date Sat, 27 Oct 2012 01:54:39 +0300
parents d89b403f630b
children
line source
1 uniform sampler2D fbtex;
2 uniform sampler3D paltex;
4 void main()
5 {
6 // lookup the render output color for this pixel
7 vec4 fbcolor = texture2D(fbtex, gl_TexCoord[0].st);
8 vec3 tc = (fbcolor.xyz * 15.0 + 0.5) / 16.0;
9 // use that color as an index into the palette
10 vec3 color = texture3D(paltex, tc).xyz;
11 // gamma-correction
13 gl_FragColor = vec4(color, fbcolor.a);
14 //gl_FragColor = vec4(pow(color, 1.0 / 2.2), fbcolor.a);
15 //gl_FragColor = vec4(sqrt(color), fbcolor.a);
16 }