2024-04-08 04:22:22 +00:00
|
|
|
#version 130
|
2023-06-29 19:55:41 +00:00
|
|
|
|
|
|
|
uniform sampler2D texture0;
|
|
|
|
uniform sampler2D texture1;
|
|
|
|
uniform sampler2D texture2;
|
|
|
|
uniform sampler2D texture3;
|
|
|
|
|
2024-04-08 04:22:22 +00:00
|
|
|
in vec2 fragmentTextureCoordinate;
|
|
|
|
flat in int fragmentTextureIndex;
|
|
|
|
in vec4 fragmentColor;
|
|
|
|
|
|
|
|
out vec4 outColor;
|
2023-06-29 19:55:41 +00:00
|
|
|
|
|
|
|
void main() {
|
|
|
|
vec4 texColor;
|
2024-04-08 04:22:22 +00:00
|
|
|
if (fragmentTextureIndex == 3)
|
2023-06-29 19:55:41 +00:00
|
|
|
texColor = texture2D(texture3, fragmentTextureCoordinate);
|
2024-04-08 04:22:22 +00:00
|
|
|
else if (fragmentTextureIndex == 2)
|
2023-06-29 19:55:41 +00:00
|
|
|
texColor = texture2D(texture2, fragmentTextureCoordinate);
|
2024-04-08 04:22:22 +00:00
|
|
|
else if (fragmentTextureIndex == 1)
|
2023-06-29 19:55:41 +00:00
|
|
|
texColor = texture2D(texture1, fragmentTextureCoordinate);
|
2024-04-08 04:22:22 +00:00
|
|
|
else
|
2023-06-29 19:55:41 +00:00
|
|
|
texColor = texture2D(texture0, fragmentTextureCoordinate);
|
2024-04-08 04:22:22 +00:00
|
|
|
|
2023-06-29 19:55:41 +00:00
|
|
|
if (texColor.a <= 0.0)
|
|
|
|
discard;
|
|
|
|
|
2024-04-08 04:22:22 +00:00
|
|
|
outColor = texColor * fragmentColor;
|
2023-06-29 19:55:41 +00:00
|
|
|
}
|