# HG changeset patch # User John Tsiombikas # Date 1350993428 -10800 # Node ID f379c00eb07fdd7c61cf26e52a0b3ee7641935d3 # Parent b05ab29cd17d4d1e7bd123ce57d76163af22edbf added samurai's texel center fix for the color grading palette lookup diff -r b05ab29cd17d -r f379c00eb07f prototype/sdr/post.p.glsl --- a/prototype/sdr/post.p.glsl Mon Oct 22 03:55:00 2012 +0300 +++ b/prototype/sdr/post.p.glsl Tue Oct 23 14:57:08 2012 +0300 @@ -5,6 +5,7 @@ { // lookup the render output color for this pixel vec4 color = texture2D(fbtex, gl_TexCoord[0].st); + vec3 tc = (color.xyz * 15.0 + 0.5) / 16.0; // use that color as an index into the palette - gl_FragColor = vec4(texture3D(paltex, color.xyz).xyz, color.a); + gl_FragColor = vec4(texture3D(paltex, tc).xyz, color.a); }