web-marbles
web-marbles copied to clipboard
Proper three.js object disposal
Description
Three.js requires us to call .dispose() on certain objects once they are no longer used, and not doing so can cause memory leaks and performance issues. Since we're not calling .dispose() anywhere in the code at the moment, it sure wouldn't hurt resolving this issue.
Minimum Acceptance Criteria Ensure the following three.js objects are cleaned up correctly (marble skins are intentionally cached and don't require cleanup when unused):
- [ ] Client: Level geometries, materials, and textures
- [ ] Client: Marble name tags (textures and materials)
- [ ] Editor: Level geometries, materials, and textures
Reference https://threejs.org/docs/index.html#manual/en/introduction/How-to-dispose-of-objects