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

29 lines
719 B
GLSL
Raw Normal View History

#version 130
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)
2023-06-29 19:55:41 +00:00
texColor = texture2D(texture3, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 2)
2023-06-29 19:55:41 +00:00
texColor = texture2D(texture2, fragmentTextureCoordinate);
else if (fragmentTextureIndex == 1)
2023-06-29 19:55:41 +00:00
texColor = texture2D(texture1, fragmentTextureCoordinate);
else
2023-06-29 19:55:41 +00:00
texColor = texture2D(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
}