From d5f5f0f372a442a17876758fa2b363f1cc1c0422 Mon Sep 17 00:00:00 2001 From: Chris Lorenzo Date: Thu, 25 Jun 2026 11:35:40 -0500 Subject: [PATCH] fix(shader): apply node opacity to RadialProgress ring/track MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ring/track colors come from u_colors / u_trackColor and don't carry worldAlpha, so a fading RadialProgress node kept its ring fully opaque (same class of bug as the gradient shaders). Scale the premultiplied `layer` by u_alpha before compositing over `base` — `base` already includes worldAlpha via v_color, so it's left untouched (no double apply). Identity at alpha=1, so existing snapshots are unchanged (verified via visual-regression compare). Co-Authored-By: Claude Opus 4.8 --- src/core/shaders/webgl/RadialProgress.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/core/shaders/webgl/RadialProgress.ts b/src/core/shaders/webgl/RadialProgress.ts index 203e754..29151f2 100644 --- a/src/core/shaders/webgl/RadialProgress.ts +++ b/src/core/shaders/webgl/RadialProgress.ts @@ -171,6 +171,13 @@ export const RadialProgress: WebGlShaderType = { layer = fillPM * fillCoverage; #endif + // Apply node opacity to the introduced ring/track colors. They come + // from u_colors / u_trackColor and do not carry worldAlpha, so without + // this a fading RadialProgress node would keep its ring fully opaque. + // \`base\` already includes worldAlpha (via v_color), so it is left as-is + // to avoid double-applying. Scaling a premultiplied layer is valid. + layer *= u_alpha; + // Premultiplied "over": out = src + dst*(1 - src.a). The output stays // visible on a fully-transparent \`base\` because layer brings its own alpha. float la = clamp(layer.a, 0.0, 1.0);