[re-implement] InstancedMesh optimizations for repeated geometry #482
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Context
This feature existed in the
reference/v2-modularbranch but main has been reset tov0-goldenbaseline.See the reference branch for implementation details.
Original issue: #425, 415
Acceptance Criteria
node --check app.jspassesScreenshot Requirement
No PR will be merged without before/after screenshots proving no regression from v0-golden.
PR created: #503
Implemented InstancedMesh optimizations for two repeated-geometry groups in
app.js:Portal tori (3 → 1 draw call): Replaced per-portal
TorusGeometry + MeshStandardMaterial + Meshwith a singleInstancedMeshusingMeshBasicMaterial + AdditiveBlending. Per-instance colors encode each portal's tint. Animation loop writes instance matrices each frame. Raycasting usesintersectObject(portalRingIM)+instanceId.Ambient runestones (5 → 1 draw call): Replaced 5 individual octahedron meshes with a single
InstancedMesh. Eliminated 5scene.getObjectByName()traversals per frame.Total: 8 draw calls reduced to 2.
node --check app.jspasses.