2011-12-25 10:42:39 +00:00
|
|
|
//precision mediump float;
|
2011-12-26 08:42:23 +00:00
|
|
|
uniform sampler2D texture;
|
2011-12-25 06:53:12 +00:00
|
|
|
uniform sampler2D palette;
|
2011-12-28 00:04:26 +00:00
|
|
|
varying vec4 color;
|
2011-12-25 10:42:39 +00:00
|
|
|
varying vec2 st;
|
2011-12-25 06:53:12 +00:00
|
|
|
|
|
|
|
void
|
|
|
|
main (void)
|
|
|
|
{
|
2011-12-25 10:42:39 +00:00
|
|
|
float pix;
|
2011-12-25 06:53:12 +00:00
|
|
|
|
2011-12-26 08:42:23 +00:00
|
|
|
pix = texture2D (texture, st).r;
|
2011-12-26 01:16:16 +00:00
|
|
|
if (pix == 1.0)
|
|
|
|
discard;
|
2011-12-28 00:04:26 +00:00
|
|
|
gl_FragColor = texture2D (palette, vec2 (pix, 0.5)) * color;
|
2011-12-25 06:53:12 +00:00
|
|
|
}
|