dungeon_crawler

diff 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 diff
     1.1 --- a/prototype/sdr/post.p.glsl	Mon Oct 22 03:55:00 2012 +0300
     1.2 +++ b/prototype/sdr/post.p.glsl	Tue Oct 23 14:57:08 2012 +0300
     1.3 @@ -5,6 +5,7 @@
     1.4  {
     1.5  	// lookup the render output color for this pixel
     1.6  	vec4 color = texture2D(fbtex, gl_TexCoord[0].st);
     1.7 +	vec3 tc = (color.xyz * 15.0 + 0.5) / 16.0;
     1.8  	// use that color as an index into the palette
     1.9 -	gl_FragColor = vec4(texture3D(paltex, color.xyz).xyz, color.a);
    1.10 +	gl_FragColor = vec4(texture3D(paltex, tc).xyz, color.a);
    1.11  }