241:b53bd6ab2a47 | 242:6eeb987f1681 |
---|---|
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 } |