arupbiswas09/claude_skills/threejs
Claude Code and agent skill by arupbiswas09/claude_skills
- community
- ext:[{"type":"plugin","description":"Custom plugin integration"}]
Checking that the SKILL.md file is still in the repository.
Core Three.js skill for building 3D web experiences. USE when creating 3D scenes, loading GLTF/GLB models, setting up WebGL renderers, adding materials and lighting, writing GLSL shaders, post-processing effects, animation systems, physics integration, instancing, or debugging Three.js performance. Also use when the user says "make something 3D", "build a scene", mentions Three.js, WebGL, or asks about meshes, cameras, raycasting, or 3D rendering — even if they don't explicitly say "Three.js".…
Install
npx vskill@latest install arupbiswas09/claude_skills/threejsSemi-extensibleMentions customization, but needs skill-specific knowledge. Read the extensible skills standard
SKILL.md
The same SKILL.md was published earlier as arupbiswas09/claude_skills/threejs.
Three.js — Core 3D Skill
Build 3D web experiences with Three.js. Covers scene setup through production deployment.
Quick Start (Vanilla)
Top 10 Gotchas (Know These Cold)
1. Memory Leaks — The #1 Three.js Footgun
scene.remove(mesh) does NOT free GPU memory. You MUST dispose:
Recursive helper: see references/patterns.md "Disposal Helper".
2. sRGB Color Space
Color textures (map, emissiveMap) → texture.colorSpace = THREE.SRGBColorSpace Data textures (normalMap, roughnessMap, metalnessMap, aoMap) → leave as default (linear). Renderer: renderer.outputColorSpace = THREE.SRGBColorSpace (default). Why: Renderer does linear workflow — converts sRGB→linear for lighting math→sRGB for display. Without this, colors look washed out.
3. Pixel Ratio — ALWAYS Cap at 2
Why: DPR 3 = 9x pixels vs DPR 1. Mobile devices report DPR 3-5. Rendering at full res kills performance with imperceptible quality gain.
4. Shadow Acne
Use shadow.normalBias = 0.05 (preferred over shadow.bias). Tighten the shadow camera frustum to your scene bounds. Keep shadow.bias close to 0.
5. Clock.getDelta() — Call Exactly Once Per Frame
getDelta() returns time since its last call. Calling it twice = second call returns ~0. Never mix getDelta() and getElapsedTime() (the latter calls getDelta internally).
6. Z-Fighting
Keep near/far ratio tight (near=0.1, far=100 > near=0.001, far=100000). Use material.polygonOffset = true for coplanar surfaces. Last resort: logarithmicDepthBuffer: true on renderer (performance cost).
7. Transparent Object Sorting
Three.js sorts transparent objects by center distance to camera — fails for overlapping/large objects. Fixes: mesh.renderOrder, use alphaTest instead of transparent, set depthWrite = false for particles.
8. Never Create Objects in the Render Loop
9. Frustum Culling
Enabled by default (object.frustumCulled = true). If objects disappear when near screen edge, their bounding sphere is too small — call geometry.computeBoundingSphere() after modifying vertices.
10. renderer.info for Debugging
If geometry/texture counts grow over time → you have a memory leak.
Materials — When to Use What
| Material | Lighting | PBR | Use Case | |
|---|---|---|---|---|
MeshBasicMaterial | No | No | Unlit, wireframes, debug, skyboxes | |
MeshLambertMaterial | Yes | No | Cheap diffuse (mobile perf) | |
MeshPhongMaterial | Yes | No | Shiny surfaces (legacy) | |
MeshStandardMaterial | Yes | Yes | Default choice. Metalness/roughness PBR | |
MeshPhysicalMaterial | Yes | Yes | Glass, car paint, fabric, iridescence (GPU cost per feature) | |
ShaderMaterial | Custom | Custom | Custom GLSL with built-in uniforms prepended | |
RawShaderMaterial | Custom | Custom | Full GLSL control, nothing prepended |
Start with MeshStandardMaterial. Upgrade to Physical only for specific effects.
Performance Budgets
| Metric | Mobile | Desktop | |
|---|---|---|---|
| FPS | 30+ | 60 | |
| Frame time | <33ms | <16ms | |
| Draw calls | <100 | <500 | |
| Triangles | <100K | <1M | |
| Textures (total) | <100MB | <500MB | |
| Unique materials | <50 | <200 |
Key Architecture Patterns
- Share geometries and materials across meshes (reduces draw calls)
- InstancedMesh for 100+ identical objects (single draw call)
- BatchedMesh (r160+) for different geometries + same material (single draw call)
- LOD for 2-3 detail levels based on camera distance
- Object pooling for frequently spawned/despawned objects
- Fixed timestep for physics (accumulator pattern,
fixedDT = 1/60) - Merge static geometry with
BufferGeometryUtils.mergeGeometries()
Latest Three.js State (March 2026)
- Current release: r175
- WebGPU: Production since r171. All major browsers. Up to 5x over WebGL.
- TSL: Introduced r166, stable r171+. Use
webgpu-threejs-tslskill for this. - BatchedMesh: r160+. Different geometries, same material, one draw call.
Reference Files
| File | When to Load | |
|---|---|---|
references/patterns.md | Loading models, disposal helpers, animation, scroll-driven 3D, raycasting | |
references/lighting-shadows.md | Setting up lights, shadow configuration, CSM | |
references/shaders.md | Custom GLSL, ShaderMaterial, onBeforeCompile, uniforms | |
references/post-processing.md | EffectComposer, bloom, SSAO, FXAA/SMAA, custom passes | |
references/physics.md | Rapier, cannon-es integration, fixed timestep | |
references/instancing.md | InstancedMesh, BatchedMesh, LOD, merge geometries | |
references/environment.md | HDR/EXR loading, PMREMGenerator, scene.environment |
Related Skills
webgpu-threejs-tsl— WebGPU renderer, TSL node materials, compute shadersthreejs-ecs— ECS game architecture, game systemsr3f— React Three Fiber (if installed)blender— 3D modeling, export to GLTF/GLB
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files.
- Model reviewNot runA model review is scheduled for the next rescan.
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingskills/threejs/SKILL.md
Popularity
- 7-day trend score
- 0
Not refreshed yet.
Extension points
pluginCustom plugin integration
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/arupbiswas09/claude_skills/threejs)