summaryrefslogtreecommitdiff
path: root/res/text.f.glsl
blob: 5ba7255ddefa8a19a90d0d70f3fcdb84ebf34b11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#version 330 core
in vec2 TexCoords;
in vec3 fg;
in vec3 bg;
flat in int background;

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

uniform sampler2D mask;

void main()
{
    if (background != 0) {
        alphaMask = vec4(1.0, 1.0, 1.0, 1.0);
        color = vec4(bg, 1.0);
    } else {
        alphaMask = vec4(texture(mask, TexCoords).rgb, 1.0);
        color = vec4(fg, 1.0);
    }

}