Install
openclaw skills install threejsBuild 3D web experiences with proper resource management and performance patterns.
openclaw skills install threejs.dispose() on geometries, materials, and textures before removing objects — Three.js never garbage collects GPU resources automaticallymesh.geometry.dispose(); mesh.material.dispose(); scene.remove(mesh) — missing any step causes memory leaksrenderer.setAnimationLoop(animate) instead of manual requestAnimationFrame — it handles VR, pauses when tab is hidden, and provides proper timingclock.getDelta() for frame-independent movement — raw frame counting breaks on different refresh ratescamera.aspect = width/height; camera.updateProjectionMatrix(); renderer.setSize(width, height)updateProjectionMatrix() after aspect change causes stretched/squished renderingrenderer.setPixelRatio(Math.min(window.devicePixelRatio, 2)) — values above 2 kill performance with minimal visual benefitimport { OrbitControls } from 'three/addons/controls/OrbitControls.js' — the path varies by bundler, check your setupcontrols.enableDamping = true with OrbitControls and call controls.update() in render loop — without this, damping silently failsnew THREE.AmbientLight(0xffffff, 0.5)) as baseline — scenes with only directional lights have pitch-black shadowsBufferGeometryUtils.mergeBufferGeometries() — each mesh is a draw call, fewer meshes = fasterInstancedMesh for many identical objects — hundreds of draw calls become oneobject.frustumCulled = true (default) but verify large objects aren't disappearing at edges — bounding sphere may be wrongrenderer.info to debug draw calls, triangles, and textures in memorymixer.update(delta) every frame with actual delta time — passing 0 or skipping frames breaks animationsSkeletonHelper during development to debug bone issues