From 6e53c47e68c1d15032b755270568eb5485f2c684 Mon Sep 17 00:00:00 2001 From: vaxerski Date: Sun, 6 Aug 2023 20:46:00 +0200 Subject: [PATCH] renderer: fix missing premultiplication for border multisampling --- src/render/shaders/Border.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/render/shaders/Border.hpp b/src/render/shaders/Border.hpp index 4e5bfd97..d881dc5b 100644 --- a/src/render/shaders/Border.hpp +++ b/src/render/shaders/Border.hpp @@ -54,6 +54,7 @@ void main() { highp vec2 pixCoord = vec2(gl_FragCoord); highp vec2 originalPixCoord = v_texcoord; originalPixCoord *= fullSizeUntransformed; + float additionalAlpha = 1.0; vec4 pixColor = vec4(1.0, 1.0, 1.0, 1.0); @@ -86,7 +87,7 @@ void main() { distances /= 4.0; - pixColor[3] *= distances; + additionalAlpha *= distances; } else if (dist > radius || dist < radius - thick) discard; @@ -113,6 +114,6 @@ void main() { pixColor = getColorForCoord(v_texcoord); - gl_FragColor = pixColor * alpha; + gl_FragColor = pixColor * alpha * additionalAlpha; } )#";