fix(shader): apply node opacity to RadialProgress ring/track#113
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #112 (the gradient transparency fixes). While auditing the other gradient/effect shaders for the same alpha-compositing issue,
RadialProgresshad it too.Problem
The ring/track colors come from
u_colors/u_trackColor, which do not carryworldAlpha. The shader composited them overbasebut never appliedu_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) byu_alphabefore the "over" composite.basealready includesworldAlphaviav_color, so it's left untouched to avoid double-applying. Scaling a premultiplied color by a scalar is a valid group-opacity operation.Notes
alpha == 1, so all existing snapshots are unchanged — verified with a visual-regression compare run (shader-radial-progressPASS, 0 diffs).getGradientColoralready returns on all paths (unlike the LinearGradient case in fix(shader): correct linear & radial gradient transparency #112), so no missing-return fix needed here.HolePunchdeclaresu_alphabut doesn't apply it — that's correct, since it only masks existingv_colorcontent (which already carries opacity); applyingu_alphathere would double it.Rounded/Border/Shadowalready applyu_alpha.pnpm buildclean · unit tests pass · prettier/eslint clean.🤖 Generated with Claude Code