RuleSource Checked
Dispose Three.js GPU resources explicitly
Remove stale geometries, materials, textures, and render targets when scenes change.
Ready to use
Rule text
When a Three.js object leaves the application for good, dispose its geometry, materials, textures, and render targets. Removing an object from the scene does not release the GPU resources it allocated.Why it helps
The reasoning behind the entry
Long-running editors and games can slowly exhaust GPU memory when scene teardown only removes object references.
Filed under
Use it in more than one place
- Ecosystem
- Three.jsReact Three Fiber
- Platform
- Web