Debian Codegraph @

tests/data/proto_copy_test/shader.frag

raw
1 #version 130
2
3 uniform sampler2D tex;
4 uniform sampler2D palette;
5
6 varying vec4 coord;
7
8 void main(void) {
9 int index = int(round(texture2D(tex, coord.xy).r * 255.0));
10 if (index == 255) discard;
11 gl_FragColor = texelFetch(palette, ivec2(index, 0), 0);
12 }