osb/assets/opensb/rendering/effects/interface.frag

29 lines
711 B
GLSL
Raw Normal View History

2024-07-06 21:32:06 +00:00
#version 140
2023-06-29 19:55:41 +00:00
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;
2023-06-29 19:55:41 +00:00
void main() {
vec4 texColor;
if (fragmentTextureIndex == 3)
2024-07-06 21:32:06 +00:00
texColor = texture(texture3, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 2)
2024-07-06 21:32:06 +00:00
texColor = texture(texture2, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 1)
2024-07-06 21:32:06 +00:00
texColor = texture(texture1, fragmentTextureCoordinate);
else
2024-07-06 21:32:06 +00:00
texColor = texture(texture0, fragmentTextureCoordinate);
2023-06-29 19:55:41 +00:00
if (texColor.a <= 0.0)
discard;
outColor = texColor * fragmentColor;
2023-06-29 19:55:41 +00:00
}