Back to Skills

threejs-webgl

Comprehensive skill for Three.js 3D web development. Use this skill when building interactive 3D scenes, WebGL/WebGPU applications, product configurators, 3D visualizations, or immersive web experiences. Triggers on tasks involving Three.js, 3D rendering, scenes, cameras, meshes, materials, lights, animations, textures, or WebGL/WebGPU rendering.

459stars66forksUpdated 7/6/2026

Security Assessment

Safe(100/100)
Security Score100/100

About threejs-webgl

Comprehensive guidance for Three.js 3D web development across both WebGL and WebGPU, aimed at building interactive scenes, product configurators, data visualizations, and immersive experiences. It grounds the reader in Three.js's scene-graph architecture and the essential components every application needs: a scene, a camera, a renderer, geometry, materials, and meshes.

Quick-start patterns show a complete WebGL scene, including a perspective camera, an antialiased renderer with shadow maps, ambient and directional lighting, OrbitControls with damping, an animation loop, and resize handling, alongside a modern WebGPU alternative via three/webgpu with tone mapping and a set animation loop. From there, common patterns cover building meshes with standard and textured materials, lighting strategies such as three-point setups, physically based point lights specified in lumens, and hemisphere lighting, and InstancedMesh for rendering thousands of similar objects efficiently with per-instance matrices and colors.

Model loading is handled with GLTFLoader plus DRACOLoader for compressed geometry, including traversing the scene to enable shadows and driving glTF animation clips through an AnimationMixer. Additional sections detail shadow configuration, covering soft shadow map types, shadow map resolution, and the light's shadow-camera frustum, and raycasting for pointer interaction by converting mouse coordinates to normalized device coordinates and intersecting scene objects. The breadth of copy-ready snippets makes it a practical reference for standing up performant, interactive 3D on the web.

FAQ

Does it support WebGPU or only WebGL?

Both. It includes a WebGLRenderer quick start and a modern WebGPURenderer setup imported from three/webgpu with tone mapping.

How does it load 3D models?

With GLTFLoader, plus DRACOLoader for compressed geometry, and it plays glTF animation clips through an AnimationMixer while traversing the model to enable shadows.

What lighting setups are covered?

Three-point lighting, physically based point lights specified in lumens, hemisphere lighting for sky and ground, and ambient, directional, fill, and rim lights.

How is interaction with objects handled?

Through raycasting, which converts mouse coordinates to normalized device coordinates and intersects scene objects to detect what was clicked.

Can it render many objects efficiently?

Yes. InstancedMesh renders thousands of similar objects using per-instance matrices and colors for performance.

All Files

8 files
assets/starter_scene/index.html1.7 KB
View
references/materials_guide.md11.1 KB
View
assets/starter_scene/main.js4.4 KB
View
references/optimization_checklist.md9.4 KB
View
assets/starter_scene/README.md2.9 KB
View
scripts/setup_scene.py6.7 KB
View
references/api_reference.md10.8 KB
View
SKILL.md15.3 KB
View

Install threejs-webgl

Download and extract the skill files to your .claude/skills/ directory.

Quick Setup:

  1. Copy the skill folder to .claude/skills/
  2. Claude will automatically detect and use the skill