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-code

Installs 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

More from cloudai-x/threejs-skills

All 10
1shopify avatarshopify-adminshopify/shopify-ai-toolkitWrite or explain **Admin GraphQL** queries and mutations for apps and integrations that extend the Shopify admin. Use when the user wants to **understand, desig17.8Kskills.sh installs
2warpdotdev avatarreadoutwarpdotdev/common-skillsProduce a polished, self-contained HTML "readout" document under ~/.readouts (with an auto-maintained index page), either by snapshotting the findings accumulat17.7Kskills.sh installs
3wshobson avataropenapi-spec-generationwshobson/agentsGenerate and maintain OpenAPI 3.1 specifications from code, design-first specs, and validation patterns. Use when creating API documentation, generating SDKs, o17Kskills.sh installs
4tw93 avatarwritetw93/wazaRewrites and polishes prose in Chinese or English, removes AI-like wording, and reviews product localization copy while preserving intent for drafts, docs, rele15.9Kskills.sh installs
5madteacher avatarflutter-animationsmadteacher/mad-agents-skillsAdd, fix, refactor, debug, test, or explain Flutter animations and motion effects. Use when working with implicit animations such as AnimatedContainer, Animated15.5Kskills.sh installs
6wecomteam avatarwecom-unifiedwecomteam/wecom-unified企业微信 CLI 全能套件,覆盖通讯录、消息、文档、日程、会议、待办 6 大业务域。支持按姓名/别名查找联系人、收发消息(文本/图片/文件/语音/视频)、读取/创建/编辑文档(可由'https://doc.weixin.qq.com/XXXX'链接触发)、创建/读取/修改表格(在线表格)内容、追加行、增删子工作表、读写14.9Kskills.sh installs