aboutsummaryrefslogtreecommitdiff
path: root/res/text.f.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'res/text.f.glsl')
-rw-r--r--res/text.f.glsl12
1 files changed, 10 insertions, 2 deletions
diff --git a/res/text.f.glsl b/res/text.f.glsl
index d2defb39..5ba7255d 100644
--- a/res/text.f.glsl
+++ b/res/text.f.glsl
@@ -1,6 +1,8 @@
#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;
@@ -9,6 +11,12 @@ uniform sampler2D mask;
void main()
{
- alphaMask = vec4(texture(mask, TexCoords).rgb, 1.0);
- color = vec4(fg, 1.0);
+ 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);
+ }
+
}