ddnet/data/shader/quad.frag

23 lines
457 B
GLSL
Raw Normal View History

2020-08-19 05:05:51 +00:00
#ifdef TW_QUAD_TEXTURED
uniform sampler2D gTextureSampler;
#endif
2020-08-19 05:05:51 +00:00
uniform vec4 gVertColors[TW_MAX_QUADS];
2020-08-19 05:05:51 +00:00
noperspective in vec4 QuadColor;
flat in int QuadIndex;
#ifdef TW_QUAD_TEXTURED
noperspective in vec2 TexCoord;
#endif
out vec4 FragClr;
void main()
{
2020-08-19 05:05:51 +00:00
#ifdef TW_QUAD_TEXTURED
vec4 TexColor = texture(gTextureSampler, TexCoord);
FragClr = TexColor * QuadColor * gVertColors[QuadIndex];
#else
FragClr = QuadColor * gVertColors[QuadIndex];
#endif
}