BjornMelin/dev-skills / plugins/web-motion/skills/web-three-r3f
web-three-r3f
VerifiedUse this skill for Three.js, React Three Fiber, Drei, Canvas/createRoot lifecycle, loaders, GLTF, useFrame, disposal, SSR/client boundaries, DPR, and browser proof. Trigger on Three.js, THREE, @react-three/fiber, @react-three/drei, R3F Canvas, useFrame, GLTF, WebGLRenderer. Do not use for near-miss tasks outside these boundaries; route to adjacent motion or platform skills when they own the implementation.
references/docs-three-disposal.md
View on GitHub# Three.js Disposal Source Notes
Source: https://threejs.org/manual/en/how-to-dispose-of-objects.html
Checked: 2026-06-04.
Use this file when a task creates or replaces Three.js resources outside R3F's
declarative ownership.
## Disposal Rules
- Three.js cannot infer application lifetime for objects created by user code.
The app must call disposal APIs when resources become obsolete.
- Dispose obsolete `BufferGeometry`, `Material`, `Texture`, `WebGLRenderTarget`,
`Skeleton`, controls, postprocessing passes, and renderers according to their
APIs.
- Removing a mesh from a scene does not dispose its geometry or material.
- `Material.dispose()` does not dispose textures; textures may be shared.
- `Texture.dispose()` does not close an `ImageBitmap`; app code that creates
ImageBitmap sources owns `ImageBitmap.close()` when appropriate.
- `renderer.info.memory` is useful for leak checks, but some internally cached
Three.js resources may remain visible there without being leaks.
## Plain Renderer Lifecycle
- Stop the render loop before disposing: cancel RAF, stop controls or mixers,
or call `renderer.setAnimationLoop(null)` for animation-loop renderers.
- Remove resize, pointer, visibility, context-loss, and custom DOM listeners
owned by the scene.
- Dispose postprocessing composers/passes, render targets, controls, and
renderer-owned resources when their route/component owner unmounts.
- Treat renderer disposal as terminal. Recreate controls/renderers after
disposal instead of reusing disposed instances.
Related skills
| Skill | Stars | Updated | Works with | Status | Install |
|---|---|---|---|---|---|
| reverse-engineer-anythingmorluto/reaReverse engineer native, managed, Electron/JavaScript, packaged, firmware, and browser targets with REA, and build agent environments (AgentEnv bundles) of web applications from a live instance or a capture, and of Linux desktop apps with a task from a request. Use shipped-artifact or requested runtime evidence to explain features, compare versions, decompile code, or guide a reconstruction. Skip REA for ordinary source-repository architecture analysis. | Stars: 471k | Updated | Claude CodeCodex | Verified | Install |
| diagnosing-superpowersobra/superpowersUse when a superpowers session went wrong and your human partner wants to know why — repeated work, ignored plans, stumbles, poor results, a skill that didn't fire, "it took too long", "why is it so expensive", "what is it doing" — or wants to build a bug report for the superpowers maintainers, for the current session or a past one identified by id or path, on any harness. | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| dispatching-parallel-agentsobra/superpowersUse when facing 2+ independent tasks that can be worked on without shared state or sequential dependencies | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |
| executing-plansobra/superpowersUse when executing an implementation plan in the current session as the implementer yourself — your human partner chose inline execution, or no subagent tool is available | Stars: 322k | Updated | Claude CodeCodex | Verified | Install |