quakeforge/libs/video/renderer/glsl/quake2d.frag
Bill Currie 151cc05882 Add support for vertex colors.
As I need to control the alpha, they're sent as rgba rather than quake
palette indices. Text works well. All other 2d stuff does not :(.
2011-12-28 09:04:26 +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.5)) * color;
}