mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-15 08:16:13 +03:00
renderer/{metal,opengl}: need to premult our cell alpha to have effect
This commit is contained in:
@ -39,7 +39,8 @@ void main() {
|
|||||||
|
|
||||||
case MODE_FG:
|
case MODE_FG:
|
||||||
a = texture(text, glyph_tex_coords).r;
|
a = texture(text, glyph_tex_coords).r;
|
||||||
out_FragColor = vec4(color.rgb*a, color.a*a);
|
vec3 premult = color.rgb * color.a;
|
||||||
|
out_FragColor = vec4(premult.rgb*a, a);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MODE_FG_COLOR:
|
case MODE_FG_COLOR:
|
||||||
|
@ -160,8 +160,12 @@ fragment float4 uber_fragment(
|
|||||||
|
|
||||||
// We premult the alpha to our whole color since our blend function
|
// We premult the alpha to our whole color since our blend function
|
||||||
// uses One/OneMinusSourceAlpha to avoid blurry edges.
|
// uses One/OneMinusSourceAlpha to avoid blurry edges.
|
||||||
|
// We first premult our given color.
|
||||||
|
float4 premult = float4(in.color.rgb * in.color.a, 1);
|
||||||
|
// Then premult the texture color
|
||||||
float a = textureGreyscale.sample(textureSampler, coord).r;
|
float a = textureGreyscale.sample(textureSampler, coord).r;
|
||||||
return in.color * a;
|
premult = premult * a;
|
||||||
|
return premult;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MODE_FG_COLOR: {
|
case MODE_FG_COLOR: {
|
||||||
|
Reference in New Issue
Block a user