[claude] InstancedMesh for portal tori + merged tile edge geometry (#415) #464

Merged
Timmy merged 1 commits from claude/issue-415 into main 2026-03-25 01:30:33 +00:00

1 Commits

Author SHA1 Message Date
Alexander Whitestone
8ca8e82b50 perf: InstancedMesh for portal tori + merged tile edge geometry (#415)
All checks were successful
CI / validate (pull_request) Successful in 10s
CI / auto-merge (pull_request) Successful in 4s
Two geometry batching wins to cut draw calls:

1. portals.js — Convert N individual portal Mesh objects to a single
   InstancedMesh. Online/offline brightness is encoded into per-instance
   color (AdditiveBlending: output = bg + color), so one shared material
   handles all portals. Exports refreshPortalInstanceColors() for health
   checks to call after status updates.

2. platform.js — Replace 69 individual LineSegments (one per glass tile,
   each with a cloned material) with a single merged LineSegments whose
   BufferGeometry holds all tile edge vertices pre-transformed to world
   position. glassEdgeMaterials export is kept as an empty array for
   API compatibility.

3. weather.js — Update runPortalHealthChecks() to call
   refreshPortalInstanceColors() instead of iterating portal group
   children to update per-mesh material opacity.

Draw call reduction: ~72 → ~2 for these elements (69 edge + 3 portals).

Refs #415

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-24 21:29:09 -04:00