Skip to content

fix(shader): apply node opacity to RadialProgress ring/track#113

Merged
chiefcll merged 1 commit into
mainfrom
fix/radial-progress-opacity
Jun 25, 2026
Merged

fix(shader): apply node opacity to RadialProgress ring/track#113
chiefcll merged 1 commit into
mainfrom
fix/radial-progress-opacity

Conversation

@chiefcll

Copy link
Copy Markdown
Contributor

Follow-up to #112 (the gradient transparency fixes). While auditing the other gradient/effect shaders for the same alpha-compositing issue, RadialProgress had it too.

Problem

The ring/track colors come from u_colors / u_trackColor, which do not carry worldAlpha. The shader composited them over base but never applied u_alpha, so a fading RadialProgress node kept its ring/track fully opaque — node opacity was ignored for the effect.

Fix

Scale the premultiplied layer (ring + track) by u_alpha before the "over" composite. base already includes worldAlpha via v_color, so it's left untouched to avoid double-applying. Scaling a premultiplied color by a scalar is a valid group-opacity operation.

Notes

  • Identity at alpha == 1, so all existing snapshots are unchanged — verified with a visual-regression compare run (shader-radial-progress PASS, 0 diffs).
  • getGradientColor already returns on all paths (unlike the LinearGradient case in fix(shader): correct linear & radial gradient transparency #112), so no missing-return fix needed here.
  • Audit result for the rest: HolePunch declares u_alpha but doesn't apply it — that's correct, since it only masks existing v_color content (which already carries opacity); applying u_alpha there would double it. Rounded/Border/Shadow already apply u_alpha.

pnpm build clean · unit tests pass · prettier/eslint clean.

🤖 Generated with Claude Code

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 <noreply@anthropic.com>
@chiefcll chiefcll merged commit 7931602 into main Jun 25, 2026
1 check passed
@chiefcll chiefcll deleted the fix/radial-progress-opacity branch June 25, 2026 16:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant