[claude] InstancedMesh optimizations for repeated geometry (#482) #503

Closed
claude wants to merge 1 commits from claude/issue-482 into main

1 Commits

Author SHA1 Message Date
Alexander Whitestone
d653f74d8d feat: InstancedMesh optimizations for repeated geometry
Some checks failed
CI / validate (pull_request) Failing after 6s
Re-implement InstancedMesh optimizations from reference/v2-modular into
the v0-golden monolithic app.js:

- Portal tori: 3 individual MeshStandardMaterial Meshes → 1 InstancedMesh
  with per-instance colors (AdditiveBlending). Reduces 3 draw calls to 1.
- Runestones: 5 individual MeshStandardMaterial Meshes (each fetched via
  scene.getObjectByName per frame) → 1 InstancedMesh. Reduces 5 draw calls
  to 1 and eliminates 5 scene traversals per frame.
- Raycasting updated to use intersectObject(portalRingIM) with instanceId.
- Animation loop updated to write instance matrices via _imDummy (no
  per-frame Object3D allocation).

Fixes #482

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 23:11:57 -04:00