diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/text.f.glsl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/res/text.f.glsl b/res/text.f.glsl index 70d50b38..dd60333c 100644 --- a/res/text.f.glsl +++ b/res/text.f.glsl @@ -21,15 +21,17 @@ flat in int background; layout(location = 0, index = 0) out vec4 color; layout(location = 0, index = 1) out vec4 alphaMask; +uniform float bgOpacity; uniform sampler2D mask; void main() { if (background != 0) { - alphaMask = vec4(1.0, 1.0, 1.0, 1.0); - color = vec4(bg + vb, 1.0); + alphaMask = vec4(1.0); + color = vec4(bg + vb, 1.0) * bgOpacity; } else { - alphaMask = vec4(texture(mask, TexCoords).rgb, 1.0); + vec3 textColor = texture(mask, TexCoords).rgb; + alphaMask = vec4(textColor, textColor.r); color = vec4(fg, 1.0); } } |