"매 thousands of meshes 매 single draw call". THREE.InstancedMesh 매 same-geometry+material 매 N copies 매 GPU instancing 매 single draw — 매 forest, crowd, particle, voxel 의 standard pattern. 2026 매 r170+ 매 BatchedMesh (multi-geometry instancing) 매 추가됨.
매 핵심
매 InstancedMesh vs alternatives
Mesh × N: 매 N draw calls. 매 simple, 매 slow at >100.
InstancedMesh: 매 1 draw call, 매 same geom/material, 매 per-instance matrix + color.
BatchedMesh (r150+): 매 1 draw call, 매 different geom 가능, 매 same material.
Custom shader InstancedBufferGeometry: 매 full control, 매 boilerplate.
매 Per-instance attributes
setMatrixAt(i, matrix) — 매 position/rotation/scale.
setColorAt(i, color) — 매 per-instance tint (requires instanceColor).
Custom InstancedBufferAttribute — 매 임의 per-instance data (HP, age, type).
매 응용
Forest/foliage: 10k 매 trees 매 60fps.
Crowd simulation: 매 NPCs 매 unique pose 매 transform.
Voxel terrain: 매 cube instance 매 chunk.
Particle system: 매 GPU-driven particle.
Bullet patterns: 매 bullet hell 매 thousands of bullets.
언제: 매 three.js 매 thousands of repeated objects; 매 WebGL 매 draw call optimization.
언제 X: 매 단일 unique mesh; 매 Unity (different API); 매 native C++ engine (use API-specific instancing).
❌ 안티패턴
Per-frame full rebuild: 매 모든 matrix 매 update — 매 변하지 않는 instance 매 skip.
Forgetting needsUpdate: 매 setMatrixAt 후 매 GPU 매 stale.
InstancedMesh × different materials: 매 불가능 — BatchedMesh or 분리.
Raycast against 100k instances every frame: 매 BVH (three-mesh-bvh) 사용.
🧪 검증 / 중복
Verified (three.js docs r170, official examples webgl_instancing_*, BatchedMesh PR #25556).
신뢰도 A.
🕓 Changelog
날짜
변경
2026-05-08
Phase 1
2026-05-10
Manual cleanup — full content (instancing patterns + BatchedMesh)