diff options
Diffstat (limited to 'res')
-rw-r--r-- | res/text.f.glsl | 7 | ||||
-rw-r--r-- | res/text.v.glsl | 7 |
2 files changed, 8 insertions, 6 deletions
diff --git a/res/text.f.glsl b/res/text.f.glsl index dd60333c..5915960f 100644 --- a/res/text.f.glsl +++ b/res/text.f.glsl @@ -14,7 +14,7 @@ #version 330 core in vec2 TexCoords; in vec3 fg; -in vec3 bg; +in vec4 bg; flat in float vb; flat in int background; @@ -27,8 +27,11 @@ uniform sampler2D mask; void main() { if (background != 0) { + if (bg.a == 0.0) + discard; + alphaMask = vec4(1.0); - color = vec4(bg + vb, 1.0) * bgOpacity; + color = vec4(bg.rgb + vb, 1.0); } else { vec3 textColor = texture(mask, TexCoords).rgb; alphaMask = vec4(textColor, textColor.r); diff --git a/res/text.v.glsl b/res/text.v.glsl index 081ca6b9..9580c71f 100644 --- a/res/text.v.glsl +++ b/res/text.v.glsl @@ -26,11 +26,11 @@ layout (location = 3) in vec4 uv; // text fg color layout (location = 4) in vec3 textColor; // Background color -layout (location = 5) in vec3 backgroundColor; +layout (location = 5) in vec4 backgroundColor; out vec2 TexCoords; out vec3 fg; -out vec3 bg; +out vec4 bg; // Terminal properties uniform vec2 termDim; @@ -63,7 +63,6 @@ void main() gl_Position = projection * vec4(finalPosition.xy, 0.0, 1.0); TexCoords = vec2(0, 0); } else { - // Glyphs are offset within their cell; account for y-flip vec2 cellOffset = vec2(glyphOffset.x, glyphOffset.y - glyphSize.y); @@ -76,6 +75,6 @@ void main() vb = visualBell; background = backgroundPass; - bg = backgroundColor / vec3(255.0, 255.0, 255.0); + bg = vec4(backgroundColor.rgb / 255.0, backgroundColor.a); fg = textColor / vec3(255.0, 255.0, 255.0); } |