Instanced rendering of all boxes#773
Conversation
🦋 Changeset detectedLatest commit: 345410e The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
|
Claude (@claude) review |
|
Claude finished Micheal Parks (@micheal-parks)'s task in 5m 10s —— View job Review
Overall this is solid work. The architecture is well-thought-out — microtask coalescing mirrors the WorldMatrix system, the transform/appearance dirty split is a nice optimization, and the boundingSphere workaround is well-documented. The refactor of BugMissing
ImportantFree-list sync between face and edge meshes is implicit → Both No tests for This function is used in three separate places (rendering, selection, focus framing) and is the canonical box-matrix composition logic the PR description says should be a template. Missing Minor
Version note on the |
…into instanced-boxes
| const invisible = useTrait(entity, traits.InheritedInvisible) | ||
| const events = createEntityEvents(entity, cursor) | ||
|
|
||
| const whenVisible = |
| const colorUtil = new Color() | ||
|
|
||
| /** Same resolution order as `Frame.svelte`. */ | ||
| const resolveColor = (entity: Entity): Color => { |
There was a problem hiding this comment.
nit: this should probably go into a general color helper asp
There was a problem hiding this comment.
going to be refactoring colors in a bit so that this resolution isn't even necessary.
|
|
||
| $effect(() => { | ||
| for (const entity of world.query(traits.Box)) { | ||
| dirtyTransform.add(entity) |
There was a problem hiding this comment.
why split these up if they just get enqueued and processed together anyway?
There was a problem hiding this comment.
They're only processed together here, in the one-time initial sync. At runtime the two sets diverge by design: WorldMatrix fires changed() for every box every kinematics tick, so a moving robot enqueues transform work only.
|
Claude (@claude) Final review |
|
Claude finished Micheal Parks (@micheal-parks)'s task in 5m 30s —— View job Final Review
All four issues from the previous review have been addressed. This is ready to merge. What was fixedBug: Free-list sync assumption — Resolved architecturally, which is better than an assertion. The Tests for Version note on the One nit still openThe Minor observation (no action required)
|
|
Hey Micheal Parks (@micheal-parks) — this PR has been approved and CI has been green for 3+ business days. Ready to merge? Auto-comment from overwatch. Will not re-nudge for 7 days. |
Overview
Migrates rendering of all box geometries to one
InstancedMesh2.This PR should serve as the template for how we handle instanced rendering for other geometries in the future.