summaryrefslogtreecommitdiff
path: root/res/text.f.glsl
blob: d32657128ca659353e7d31b0dd66539969d4ab9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#version 330 core
in vec2 TexCoords;
flat in int InstanceId;

layout(location = 0, index = 0) out vec4 color;
layout(location = 0, index = 1) out vec4 alphaMask;

uniform sampler2D mask;
uniform ivec3 textColor[32];

void main()
{
    int i = InstanceId;
    alphaMask = vec4(texture(mask, TexCoords).rgb, 1.0);
    vec3 textColorF = vec3(textColor[i]) / vec3(255.0, 255.0, 255.0);
    color = vec4(textColorF, 1.0);
}