gearlib-cpp/examples/assets/texture.frag
2024-05-16 22:37:46 +12:00

18 lines
345 B
GLSL

#version 460 core
layout(location = 0) out vec4 color;
struct VertexOutput {
vec4 Tint;
vec2 TexCoord;
};
layout(location = 0) in VertexOutput Input;
layout(location = 2) in flat float TexID;
layout(binding = 0) uniform sampler2D textures[32];
void main() {
color = texture(textures[int(TexID)], Input.TexCoord) * Input.Tint;
}