threejs-webgl

Build interactive 3D web scenes with Three.js WebGL and WebGPU rendering.

Updated Jun 30, 2026
One-click install
npx skills add https://github.com/ayofemiade/cleva --skill threejs-webgl-ayofemiade
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: threejs-webgl
Source: https://github.com/ayofemiade/cleva/tree/main/.claude/skills/threejs-webgl
Command: npx skills add https://github.com/ayofemiade/cleva --skill threejs-webgl-ayofemiade

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) and assets (resource) components.

What problem does it solve? Building 3D graphics in the browser requires coordinating scenes, cameras, renderers, materials, lights, and animations, and mistakes in setup, color spaces, or resource disposal cause rendering bugs and memory leaks. ## Core Features & Use Cases - Scene and Renderer Setup: Provides boilerplate patterns for WebGL and WebGPU renderers, cameras, controls, lighting rigs, and resize handling. - Materials, Models, and Interaction: Covers PBR material selection, glTF/DRACO model loading, texture configuration, raycasting, shadows, and post-processing. - Performance Optimization: Includes an optimization checklist covering InstancedMesh, LOD, texture compression, draw call reduction, and mobile targets. - Use Case: When building a product configurator, use the bundled starter scene and setup script to generate a working Three.js scene with shadows and orbit controls, then load a compressed glTF model and apply PBR materials. ## Quick Start Use the threejs-webgl skill to create a basic Three.js scene with orbit controls, shadow-enabled lighting, and a rotating cube.

Frequently Asked Questions about threejs-webgl

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up a basic Three.js scene with WebGL?▼

Create a Scene, PerspectiveCamera, and WebGLRenderer, then add lights and meshes before running a requestAnimationFrame loop that calls renderer.render. The bundled setup_scene.py script generates this boilerplate with configurable camera, lighting, and shadow options.

Which Three.js material should I use for realistic rendering?▼

MeshStandardMaterial is the recommended choice for realistic PBR rendering with roughness and metalness workflows. Use MeshPhysicalMaterial for glass, clearcoat, or transmission effects, and MeshBasicMaterial or MeshLambertMaterial when performance matters more than realism.

Does Three.js support WebGPU rendering?▼

Yes, Three.js provides a WebGPURenderer imported from three/webgpu as a modern alternative to WebGLRenderer. It uses setAnimationLoop instead of requestAnimationFrame and supports tone mapping configuration.

How do I load glTF models with Draco compression in Three.js?▼

Use GLTFLoader combined with DRACOLoader, setting the decoder path before loading. After loading, traverse the model to enable shadows on meshes and use AnimationMixer to play embedded animations.

Why does my Three.js scene have memory leaks or low FPS?▼

Leaks come from not calling dispose on geometries, materials, and textures, while low FPS usually stems from too many draw calls, large textures, or excessive shadow-casting lights. Use InstancedMesh for repeated objects and the optimization checklist to profile with renderer.info.

How do I fix z-fighting and color space issues in Three.js?▼

Fix z-fighting by increasing the near plane distance, reducing the far plane, or enabling material.polygonOffset. For washed-out colors, set texture.colorSpace to SRGBColorSpace for diffuse maps and configure renderer.outputColorSpace.