The dominant performance constraints in the 3D system are the browser WebGL context limit and texture memory — not polygon count. This guide covers both, plus the disposal discipline that keeps them under control.
Browsers enforce a hard limit on simultaneous WebGL contexts, typically 8 to 16. Because each ThreeDShapeElement creates its own renderer and therefore its own context, exceeding the limit causes the oldest context to be silently lost, leaving blank or corrupted viewports.
Texture memory is usually the larger bottleneck compared with polygon count.
| Texture Size | Approximate GPU Memory |
|---|---|
| 2048 x 2048 RGBA | ~16 MB |
| 4096 x 4096 RGBA | ~64 MB |
Multiple maps on a single material multiply this cost. The texture cache in MaterialSystem avoids loading duplicates across objects.
this.renderer.setPixelRatio(Math.min(window.devicePixelRatio, 2));On a 3x display, rendering at 3x means nine times the pixels of 1x. The visual difference between 2x and 3x is negligible while the GPU cost is not, so the ratio is capped at 2 for consistent performance across devices.
| Resource | Call | Releases |
|---|---|---|
| Geometries | geometry.dispose() | Vertex buffer GPU memory |
| Materials | material.dispose() | Shader programs |
| Textures | texture.dispose() | Texture GPU memory |
| Renderer | renderer.dispose() | The WebGL context |