Skip to content

feat(selection-ring): extract selection ring into dedicated UI pass#175

Merged
rulkens merged 12 commits into
mainfrom
worktree-selection-ring-impl
May 20, 2026
Merged

feat(selection-ring): extract selection ring into dedicated UI pass#175
rulkens merged 12 commits into
mainfrom
worktree-selection-ring-impl

Conversation

@rulkens
Copy link
Copy Markdown
Owner

@rulkens rulkens commented May 20, 2026

Implements the plan from #173.

Summary

  • New selectionRingPass at the head of UI_PASSES draws a white annulus on the swap-chain after tone-map
  • New selectionRingRenderer (factory closure) owns one pipeline, two UBOs (camera + selection), and one bind group
  • Main points pipeline drops selected varying, isSelected/sizeScale math, and the 90-line in-shader selection branch
  • colorFragment.wesl shrinks from 224 → ~96 lines

Notable changes from the plan

  • Ring size fix. The plan mirrored the in-shader formula max(pointSizePx, apparentPxRadius) * 8 byte-for-byte. Visual testing showed this ballooned on zoomed-in galaxies because apparentPxRadius already includes a 4× thumbnail-footprint padding. Halved the apparent-radius contribution: max(pointSizePx, apparentPxRadius * 0.5) * 8.
  • WESL backtick gotcha. Phase 1's WESL files used backticks in comments; wesl-plugin tokenises them and fails to parse. Fixed by replacing with single quotes (caught during Phase 2 when the renderer first ?static-imported the shaders).

Trade-off accepted

  • Removed the !isSelected bypass on the points-pipeline invisibility cull. A very faint selected galaxy's disk no longer renders, but the UI ring still does — the selection stays visually marked. (Grill Q1, accepted.)

Out of scope (follow-ups)

  • POI ring fold-in (renderer's uniform shape is type-agnostic to allow it)
  • Removing the now-unread selectedPacked slot from the points uniform + the pickRenderer.ts write that fills it

Test plan

  • All 1638 tests pass; typecheck + build clean
  • Dual-ring smoke check (Phase 3) — new pass confirmed firing via toggle isolation
  • Single-ring smoke check (Phase 4) — only the new ring renders, inner disk at normal size
  • Ring-size fix verified visually on zoomed-in galaxy

🤖 Generated with Claude Code

rulkens and others added 12 commits May 20, 2026 02:14
Extract the selection ring annulus out of the main points fragment shader
into its own UI-pass renderer. Annulus-only scope, CPU-driven uniform
sizing, type-agnostic uniform layout so POI selection can fold in later.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
…n-aligned quad

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Also replace backticks with single quotes in the selection-ring WESL
comments. wesl-plugin tokenises backticks regardless of comment context,
so a 'static suffix import would fail to parse the shader source.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The selection ring is now drawn by the dedicated selectionRingPass; the
points pipeline no longer needs the 'selected' varying, isSelected math,
or the fragment-side selection branch.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
The points pipeline bakes a 4× padding into the billboard footprint so
the soft glow blends with the textured thumbnail. The previous ring
formula multiplied the already-padded sizePx by another 8×, ballooning
the halo on zoomed-in galaxies. Halving apparentPxRadius cancels half
that padding while leaving the pointSizePx-dominated zoom-out case
unchanged.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
skymap 0df84ad Commit Preview URL

Branch Preview URL
May 20 2026, 12:48 AM

@rulkens rulkens changed the base branch from plan/selection-ring-extraction to main May 20, 2026 00:50
@rulkens rulkens merged commit da80ec4 into main May 20, 2026
1 check passed
@rulkens rulkens deleted the worktree-selection-ring-impl branch May 20, 2026 00:51
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