blob: 7d377379bb75198f56e31f43ae57dde59a0f4baa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
#version 140
uniform sampler2D texture0;
uniform sampler2D texture1;
uniform sampler2D texture2;
uniform sampler2D texture3;
in vec2 fragmentTextureCoordinate;
flat in int fragmentTextureIndex;
in vec4 fragmentColor;
out vec4 outColor;
void main() {
vec4 texColor;
if (fragmentTextureIndex == 3)
texColor = texture(texture3, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 2)
texColor = texture(texture2, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 1)
texColor = texture(texture1, fragmentTextureCoordinate);
else
texColor = texture(texture0, fragmentTextureCoordinate);
if (texColor.a <= 0.0)
discard;
outColor = texColor * fragmentColor;
}
|