From 93eb86aa3eb737ebc48879badb475a739a1f373d Mon Sep 17 00:00:00 2001 From: noneistaken <90960821+noneistaken@users.noreply.github.com> Date: Thu, 12 May 2022 23:50:08 +0700 Subject: [PATCH] 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. --- src/dxvk/hud/shaders/hud_text_frag.frag | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/dxvk/hud/shaders/hud_text_frag.frag b/src/dxvk/hud/shaders/hud_text_frag.frag index e1278fab..56a2823c 100644 --- a/src/dxvk/hud/shaders/hud_text_frag.frag +++ b/src/dxvk/hud/shaders/hud_text_frag.frag @@ -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)