Skip to content
Development
Skill

/webgpu-threejs-tsl

Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js

From plugin
webgpu-threejs-tsl
1.3k1 skill

Claude Code

$ npx -y skills add dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl --agent claude-code

SKILL.md

webgpu-threejs-tsl.SKILL.md
name: webgpu-threejs-tsl
description: Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language). Covers WebGPU renderer setup, TSL syntax and node materials, compute shaders, post-processing effects, and WGSL integration. Use this skill when working with Three.js WebGPU, TSL shaders, node materials, or GPU compute in Three.js.

WebGPU Three.js with TSL

TSL (Three.js Shading Language) is a node-based shader abstraction that lets you write GPU shaders in JavaScript instead of GLSL/WGSL strings.

Quick Start

import * as THREE from 'three/webgpu';
import { color, time, oscSine } from 'three/tsl';

const renderer = new THREE.WebGPURenderer();
await renderer.init();

const material = new THREE.MeshStandardNodeMaterial();
material.colorNode = color(0xff0000).mul(oscSine(time));

Skill Contents

Documentation

  • `docs/core-concepts.md` - Types, operators, uniforms, control flow
  • `docs/materials.md` - Node materials and all properties
  • `docs/compute-shaders.md` - GPU compute with instanced arrays
  • `docs/post-processing.md` - Built-in and custom effects
  • `docs/wgsl-integration.md` - Custom WGSL functions
  • `docs/device-loss.md` - Handling GPU device loss and recovery
  • `docs/limits-and-features.md` - WebGPU device limits and optional features

Examples

  • `examples/basic-setup.js` - Minimal WebGPU project
  • `examples/custom-material.js` - Custom shader material
  • `examples/particle-system.js` - GPU compute particles
  • `examples/post-processing.js` - Effect pipeline
  • `examples/earth-shader.js` - Complete Earth with atmosphere

Templates

  • `templates/webgpu-project.js` - Starter project template
  • `templates/compute-shader.js` - Compute shader template

Reference

  • `REFERENCE.md` - Quick reference cheatsheet

Key Concepts

Import Pattern

// Always use the WebGPU entry point
import * as THREE from 'three/webgpu';
import { /* TSL functions */ } from 'three/tsl';

Node Materials

Replace standard material properties with TSL nodes:

material.colorNode = texture(map);        // instead of material.map
material.roughnessNode = float(0.5);      // instead of material.roughness
material.positionNode = displaced;         // vertex displacement

Method Chaining

TSL uses method chaining for operations:

// Instead of: sin(time * 2.0 + offset) * 0.5 + 0.5
time.mul(2.0).add(offset).sin().mul(0.5).add(0.5)

Custom Functions

Use `Fn()` for reusable shader logic:

const fresnel = Fn(([power = 2.0]) => {
  const nDotV = normalWorld.dot(viewDir).saturate();
  return float(1.0).sub(nDotV).pow(power);
});

When to Use This Skill

  • Setting up Three.js with WebGPU renderer
  • Creating custom shader materials with TSL
  • Writing GPU compute shaders
  • Building post-processing pipelines
  • Migrating from GLSL to TSL
  • Implementing visual effects (particles, water, terrain, etc.)

Resources

  • [Three.js TSL Wiki](https://github.com/mrdoob/three.js/wiki/Three.js-Shading-Language)
  • [WebGPU Examples](https://github.com/mrdoob/three.js/tree/master/examples) (files prefixed with `webgpu_`)
Read more
@dgreenheck
Ships withwebgpu-threejs-tsl

An Agent Skill for developing WebGPU-enabled Three.js applications using TSL (Three.js Shading Language).

Stars on GitHub

Momentum

stars in total
1.3k
Star history of dgreenheck/webgpu-claude-skill on GitHub, a chart by star-history.com

More skills from other plugins.

brainstorming
Auto-invoked

brainstorming

You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…

@obra@obraInstall Skill
ask-matt

ask-matt

Ask which skill or flow fits your situation. A router over the skills in this repo.

skills12d309k
@mattpocock@mattpocockInstall Skill
accessibility
Auto-invoked

accessibility

Design, implement, and audit accessible UI to WCAG 2.2 Level AA across Web, iOS, and Android — semantic ARIA roles and labels,…

ecc2w293k
@affaan-m@affaan-mInstall Skill
compiler-commit

compiler-commit

Use when you want to verify compiler changes and commit with the correct convention. Runs tests, lint, and format, then commits…

react3d252k
@facebook@facebookInstall Skill

Questions about webgpu-threejs-tsl.

Which coding agents can use webgpu-threejs-tsl?
webgpu-threejs-tsl installs in Claude Code, Codex, Cursor, Gemini CLI, GitHub Copilot, OpenCode and Windsurf with the skills CLI, using each agent's flag shown on this page. Flowy's auto-invocation, which fires a skill when your prompt matches, runs in Claude Code only.