quakeforge/libs/video/renderer/glsl/quake2d.frag
Bill Currie 928dd92276 Use 0.0 instead of 0.5 for t for palette lookups.
I realized it's pretty silly using colormap + palette when I can just
combine the two into one and have a 2D palette. This is in preparation for
that.
2012-01-14 20:51:43 +09:00

16 lines
287 B
GLSL

//precision mediump float;
uniform sampler2D texture;
uniform sampler2D palette;
varying vec4 color;
varying vec2 st;
void
main (void)
{
float pix;
pix = texture2D (texture, st).r;
if (pix == 1.0)
discard;
gl_FragColor = texture2D (palette, vec2 (pix, 0.0)) * color;
}