
Threejs Webgl
Bootstrap performant Three.js scenes—cameras, materials, lights, and animations—for product configurators and immersive marketing pages.
Overview
Three.js WebGL is an agent skill for the Build phase that guides solo builders through Three.js scene setup, rendering, materials, lights, and animations for WebGL and WebGPU web experiences.
Install
npx skills add https://github.com/freshtechbro/claudedesignskills --skill threejs-webglWhat is this skill?
- Scene graph mental model: scene, camera, renderer, geometry, material, mesh
- WebGL and WebGPU renderer guidance for browser 3D apps
- Lighting stacks: ambient, directional, and point lights on grouped meshes
- InstancedMesh patterns for many repeated objects
- Quick-start scene setup pattern for agent-driven iteration
- Six essential components called out: scene, camera, renderer, geometry, material, mesh
Adoption & trust: 1.1k installs on skills.sh; 227 GitHub stars; 2/3 security scanners passed (skills.sh audits).
What problem does it solve?
You need a credible 3D web experience but lack a structured Three.js checklist for scenes, renderers, and performance-minded structure.
Who is it for?
Indie front-end devs shipping Three.js hero scenes, demos, or configurators inside React, Vite, or vanilla SPAs.
Skip if: Native mobile 3D (Unity/Unreal), heavy CAD pipelines, or teams that only need 2D CSS animation without WebGL.
When should I use this skill?
Building interactive 3D scenes, WebGL/WebGPU applications, product configurators, 3D visualizations, or immersive web experiences involving Three.js, meshes, materials, lights, animations, or textures.
What do I get? / Deliverables
You leave with a coherent scene graph, working renderer choice, and implementation patterns the agent can extend into configurators or visualizations.
- Scene graph with camera, lights, and meshes
- Renderer configuration and animation loop scaffolding
- Material and geometry choices documented in code
Recommended Skills
Journey fit
Build is where interactive 3D experiences are authored before Ship performance passes and Launch distribution. Frontend is the right shelf because the skill centers browser rendering, scene graphs, and WebGL/WebGPU canvas work—not server APIs.
How it compares
Skill-level Three.js procedure knowledge—not a hosted 3D SaaS or a single-purpose npm CLI.
Common Questions / FAQ
Who is threejs-webgl for?
Front-end solo builders and designers pairing with an agent to implement browser 3D using Three.js, WebGL, or WebGPU.
When should I use threejs-webgl?
Use it during Build frontend work when creating interactive scenes, product configurators, 3D visualizations, or immersive marketing pages that mention Three.js rendering.
Is threejs-webgl safe to install?
Check the Security Audits panel on this Prism catalog page and your repo policy; the skill may suggest loading external assets or shaders that you should vet.
SKILL.md
READMESKILL.md - Threejs Webgl
# Three.js WebGL/WebGPU Development ## Overview Three.js is the industry-standard JavaScript library for creating 3D graphics in web browsers using WebGL and WebGPU. This skill provides comprehensive guidance for building performant, interactive 3D experiences including scenes, cameras, renderers, geometries, materials, lights, textures, and animations. ## Core Concepts ### Scene Graph Architecture Three.js uses a hierarchical scene graph where all 3D objects are organized in a tree structure: ```javascript Scene ├── Camera ├── Lights │ ├── AmbientLight │ ├── DirectionalLight │ └── PointLight ├── Meshes │ ├── Mesh (Geometry + Material) │ └── InstancedMesh └── Groups ``` ### Essential Components Every Three.js application requires these core elements: 1. **Scene**: Container for all 3D objects 2. **Camera**: Defines the viewing perspective 3. **Renderer**: Draws the scene to canvas (WebGL or WebGPU) 4. **Geometry**: Defines the shape of objects 5. **Material**: Defines the surface appearance 6. **Mesh**: Combines geometry and material ## Quick Start Pattern ### Basic Scene Setup ```javascript import * as THREE from 'three'; import { OrbitControls } from 'three/addons/controls/OrbitControls.js'; // Scene, Camera, Renderer const scene = new THREE.Scene(); scene.background = new THREE.Color(0x333333); const camera = new THREE.PerspectiveCamera( 75, // FOV window.innerWidth / window.innerHeight, // Aspect ratio 0.1, // Near clipping plane 1000 // Far clipping plane ); camera.position.set(0, 2, 5); const renderer = new THREE.WebGLRenderer({ antialias: true }); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setPixelRatio(window.devicePixelRatio); renderer.shadowMap.enabled = true; document.body.appendChild(renderer.domElement); // Lighting const ambientLight = new THREE.AmbientLight(0xffffff, 0.5); scene.add(ambientLight); const directionalLight = new THREE.DirectionalLight(0xffffff, 1); directionalLight.position.set(5, 10, 7.5); directionalLight.castShadow = true; scene.add(directionalLight); // Controls const controls = new OrbitControls(camera, renderer.domElement); controls.enableDamping = true; controls.dampingFactor = 0.05; // Animation Loop function animate() { requestAnimationFrame(animate); controls.update(); renderer.render(scene, camera); } animate(); // Handle Resize window.addEventListener('resize', () => { camera.aspect = window.innerWidth / window.innerHeight; camera.updateProjectionMatrix(); renderer.setSize(window.innerWidth, window.innerHeight); }); ``` ### WebGPU Setup (Modern Alternative) ```javascript import * as THREE from 'three/webgpu'; const renderer = new THREE.WebGPURenderer({ antialias: true }); renderer.setPixelRatio(window.devicePixelRatio); renderer.setSize(window.innerWidth, window.innerHeight); renderer.setAnimationLoop(animate); renderer.toneMapping = THREE.LinearToneMapping; renderer.toneMappingExposure = 1; document.body.appendChild(renderer.domElement); ``` ## Common Patterns ### 1. Creating Meshes with Materials ```javascript // Basic Mesh const geometry = new THREE.BoxGeometry(1, 1, 1); const material = new THREE.MeshStandardMaterial({ color: 0x00ff00, roughness: 0.5, metalness: 0.5 }); const cube = new THREE.Mesh(geometry, material); scene.add(cube); // Textured Mesh const loader = new THREE.TextureLoader(); const texture = loader.load('texture.jpg'); texture.colorSpace = THREE.SRGBColorSpace; const texturedMaterial = new THREE.MeshStandardMaterial({ map: texture }); const mesh = new THREE.Mesh(geometry, texturedMaterial); sce