
Threejs Shaders
Covers the essentials of writing custom GLSL shaders in Three.js, from basic ShaderMaterial setup to common visual effects like Fresnel, rim lighting, and vertex displacement. You get clear examples of passing uniforms and varyings, plus the difference between ShaderMaterial (Three.js provides built-in uniforms) and RawShaderMaterial (you define everything). The patterns section is genuinely useful, with working noise functions and gradient techniques you can drop straight into projects. It won't teach you GLSL from scratch, but if you know the basics and need to see how Three.js wires everything together, this gets you writing custom shaders quickly without digging through documentation.
- skills.sh installs
- 19.7K
- GitHub stars
- 4.1K
- last updated
- Aug 21, 2026
Install
$ npx -y skills add cloudai-x/threejs-skills --skill threejs-shaders --agent claude-codeInstalls into .claude/skills of the current project.
Files
Three.js Shaders
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(60, window.innerWidth / window.innerHeight, 0.1, 100);
camera.position.set(0, 0, 2);
const material = new THREE.ShaderMaterial({
uniforms: {
time: { value: 0 },
color: { value: new THREE.Color(0x0066ff) }, // hex converted to the linear working space
},
vertexShader: /* glsl */ `
varying vec2 vUv;
void main() {
vUv = uv;
gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
}
`,
fragmentShader: /* glsl */ `
uniform float time;
uniform vec3 color;
varying vec2 vUv;
Sponsors
Details
- Repository
- github.com/cloudai-x/threejs-skills
- Categories
- Documentation, Design & UI/UX