mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-23 12:52:46 +00:00
151cc05882
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 :(.
16 lines
287 B
GLSL
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;
|
|
}
|