dungeon_crawler
view prototype/sdr/post.p.glsl @ 76:f379c00eb07f
added samurai's texel center fix for the color grading palette lookup
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Tue, 23 Oct 2012 14:57:08 +0300 |
parents | a27528035e20 |
children | d89b403f630b |
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 color = texture2D(fbtex, gl_TexCoord[0].st);
8 vec3 tc = (color.xyz * 15.0 + 0.5) / 16.0;
9 // use that color as an index into the palette
10 gl_FragColor = vec4(texture3D(paltex, tc).xyz, color.a);
11 }