threejs-materials
Agent skill fromCloudAI-X/threejs-skills
Choosing and configuring three.js materials - unlit, diffuse, specular, PBR, toon, point and line materials - shared properties like blending and stencil, environment response, and the WebGPU node-material and TSL equivalents. Use when styling meshes or tuning material behavior.
How to install threejs-materials
install threejs-materials
# install the threejs-skills pack with the skills CLI
npx skills add CloudAI-X/threejs-skills# or add only this skill to Claude Code: copy the folder
skills/threejs-materials/
# into
~/.claude/skills/threejs-materials/ (all projects)
.claude/skills/threejs-materials/ (one project)
1# Three.js Materials23Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.45## Quick Start67```javascript8import * as THREE from "three";910const renderer = new THREE.WebGLRenderer({ antialias: true });11renderer.setPixelRatio(window.devicePixelRatio);12renderer.setSize(window.innerWidth, window.innerHeight);13document.body.appendChild(renderer.domElement);1415const scene = new THREE.Scene();1617const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100);18camera.position.set(0, 0, 3);1920// PBR material - the default choice for lit, realistic surfaces21const material = new THREE.MeshStandardMaterial({22 color: 0x00aaff,23 roughness: 0.35,24 metalness: 0.1,25});26const mesh = new THREE.Mesh(new THREE.SphereGeometry(1, 48, 32), material);27scene.add(mesh);28scene.add(new THREE.HemisphereLight(0xffffff, 0x444444, 1)); // lit materials render black without lights29const light = new THREE.DirectionalLight(0xffffff, 2);30light.position.set(3, 3, 3);31scene.add(light);3233function animate() {34 mesh.rotation.y += 0.01;35 renderer.render(scene, camera);36}3738renderer.setAnimationLoop(animate);39```4041## Material Types Overview4243| Material | Use case | Lighting |44| -------------------- | ------------------------------------- | ------------------ |45| MeshBasicMaterial | Unlit color, textures, wireframes | None |46| MeshLambertMaterial | Matte diffuse surfaces | Diffuse |47…
Excerpt shown under the repository's MIT license.
