test/snake/shader/player.glsl

changeset 267
92fdd53de74f
parent 266
a73674e99e62
child 268
d8c05102b017
equal deleted inserted replaced
266:a73674e99e62 267:92fdd53de74f
1 layout(location = 0) out vec4 diffuse;
2 in vec2 uvcoord;
3
4 uniform sampler2D map_albedo;
5 uniform sampler2D map_color;
6 uniform vec4 color;
7
8 void main(void) {
9 // TODO: use greyscale texture instead
10 vec4 color_map_pixel = texture(map_color, uvcoord);
11 if (color_map_pixel.a > 0) {
12 diffuse = color * color_map_pixel * texture(map_albedo, uvcoord);
13 } else {
14 diffuse = texture(map_albedo, uvcoord);
15 }
16 }

mercurial