diff options
author | Joe Wilm <jwilm@users.noreply.github.com> | 2017-10-21 15:26:42 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-10-21 15:26:42 -0700 |
commit | b79574ee823900c21759628f92cf036271847afc (patch) | |
tree | 0147c31cde54febf034749b095513d3b5b376130 /res/text.v.glsl | |
parent | 7a5eebd0941169396557b80084c0c8f354c6840f (diff) | |
download | alacritty-b79574ee823900c21759628f92cf036271847afc.tar.gz alacritty-b79574ee823900c21759628f92cf036271847afc.zip |
Fix solid background color opacity (#847)
Since landing the patch adding transparency support to Alacritty,
there's been an issue where othewise solid background cells were also
being rendered partially transparent. Now, all filled background cells
are rendered fully opaque.
Some logic was added to support discarding filled backgrounds which had
the same color as the default background. This means that, if the
default background is #000 and a cell has that background, it will never
be rendered opaque. This may not be correct.
Note that many truecolor vim color schemes print spaces for default
colored background cells. Performance can be dramatically improved by
using ctermbg=NONE guibg=NONE to skip rendering those cells.
Diffstat (limited to 'res/text.v.glsl')
-rw-r--r-- | res/text.v.glsl | 7 |
1 files changed, 3 insertions, 4 deletions
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); } |