2020-08-29 10:10:38 +00:00
|
|
|
#ifdef TW_QUAD_TEXTURED
|
|
|
|
uniform sampler2D gTextureSampler;
|
|
|
|
#endif
|
2018-03-13 20:42:05 +00:00
|
|
|
|
2020-08-29 10:10:38 +00:00
|
|
|
uniform vec4 gVertColors[TW_MAX_QUADS];
|
2018-03-13 20:42:05 +00:00
|
|
|
|
2020-08-29 10:10:38 +00:00
|
|
|
noperspective in vec4 QuadColor;
|
|
|
|
flat in int QuadIndex;
|
|
|
|
#ifdef TW_QUAD_TEXTURED
|
|
|
|
noperspective in vec2 TexCoord;
|
|
|
|
#endif
|
2018-03-13 20:42:05 +00:00
|
|
|
|
|
|
|
out vec4 FragClr;
|
|
|
|
void main()
|
|
|
|
{
|
2020-08-29 10:10:38 +00:00
|
|
|
#ifdef TW_QUAD_TEXTURED
|
|
|
|
vec4 TexColor = texture(gTextureSampler, TexCoord);
|
|
|
|
FragClr = TexColor * QuadColor * gVertColors[QuadIndex];
|
|
|
|
#else
|
|
|
|
FragClr = QuadColor * gVertColors[QuadIndex];
|
|
|
|
#endif
|
2018-03-13 20:42:05 +00:00
|
|
|
}
|