New advertisers: 50% off your first month with code FIRSTMONTHSee slots
cloudai-x avatar

Threejs Materials

Choosing and tuning Three.js materials, from unlit basics through PBR, toon, and WebGPU node materials.

install copies · 90 days. Times the install command was copied on this site in the last 90 days, bots filtered.
8
skills.sh installs
21.3K
GitHub stars
4.3K
last updated
Aug 21, 2026
View on GitHub

What it does

  • Covers material types from MeshBasicMaterial and Lambert through Phong, Standard, Physical, Toon, and Matcap, plus point, line, and shader materials
  • Includes a lookup table mapping each material to its use case and lighting model, and notes on colorSpace for color versus scalar maps
  • Explains UV channel selection for aoMap and lightMap, and when to copy baked unwraps into uv1
  • Designed for styling meshes and tuning material behavior in WebGLRenderer or WebGPURenderer projects targeting r186

Install

$ npx -y skills add cloudai-x/threejs-skills --skill threejs-materials -y

Installs into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.

Files

Three.js Materials

Targets three.js r186. Examples use WebGLRenderer; the WebGPU and TSL section uses WebGPURenderer.

Quick Start

import * as THREE from "three";

const renderer = new THREE.WebGLRenderer({ antialias: true });
renderer.setPixelRatio(window.devicePixelRatio);
renderer.setSize(window.innerWidth, window.innerHeight);
document.body.appendChild(renderer.domElement);

const scene = new THREE.Scene();

const camera = new THREE.PerspectiveCamera(75, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(0, 0, 3);

// PBR material - the default choice for lit, realistic surfaces
const material = new THREE.MeshStandardMaterial({
  color: 0x00aaff,
  roughness: 0.35,
  metalness: 0.1,
});
const mesh = new THREE.Mesh(new THREE.SphereGeometry(1, 48, 32), material);
scene.add(mesh);
scene.add(new THREE.HemisphereLight(0xffffff, 0x444444, 1)); // lit materials render black without lights
const light = new THREE.DirectionalLight(0xffffff, 2);
light.position.set(3, 3, 3);
scene.add(light);

function animate() {
  mesh.rotation.y += 0.01;
  renderer.render(scene, camera);
}

renderer.setAnimationLoop(animate);

Material Types Overview

Details

Repository
github.com/cloudai-x/threejs-skills
Categories
3D, CAD & Modeling, Frontend & UI Code

More from cloudai-x/threejs-skills

All 10

Similar to Threejs Materials

More 3D, CAD & Modeling