Blend HUD text shadow and center correctly

This fixes incorrect blending between HUD text, which would cause a narrow transparent gap between the text center and border/shadow that is visible at large text sizes.
This commit is contained in:
noneistaken 2022-05-12 23:50:08 +07:00 committed by Philip Rebohle
parent 0678d80e89
commit 93eb86aa3e
1 changed files with 5 additions and 4 deletions

View File

@ -27,10 +27,11 @@ void main() {
float r_alpha_center = sampleAlpha(0.0f, 5.0f);
float r_alpha_shadow = sampleAlpha(0.3f, 5.0f);
vec4 r_center = vec4(v_color.rgb, v_color.a * r_alpha_center);
vec4 r_shadow = vec4(0.0f, 0.0f, 0.0f, r_alpha_shadow);
o_color = mix(r_shadow, r_center, r_alpha_center);
vec3 r_center = v_color.rgb;
vec3 r_shadow = vec3(0.0f, 0.0f, 0.0f);
o_color.rgb = mix(r_shadow, r_center, r_alpha_center);
o_color.a = r_alpha_shadow * v_color.a;
o_color.rgb *= o_color.a;
if (!srgbSwapchain)