# Webgpu Threejs Tsl

Comprehensive guide for developing WebGPU-enabled Three.js applications using TSL...

- Repository: https://github.com/dgreenheck/webgpu-claude-skill (1267 stars)
- Category: Engineering
- License: see repository
- Last updated: 2026-04-10
- Runs scripts: yes, review before use

## Install

Claude Code: `npx skills add dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl -g -a claude-code -y`
Codex: `npx skills add dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl -g -a codex -y`
Cursor: `npx skills add dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl -g -a cursor -y`
Gemini CLI: `npx skills add dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add dgreenheck/webgpu-claude-skill`

## 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.

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# 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

```javascript
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
```javascript
// 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:
```javascript
material.colorNode = texture(map);        // instead of material.map
material.roughnessNode = float(0.5);      // instead of material.roughness
material.positionNode = displaced;         // vertex displacement
```

The rest: https://github.com/dgreenheck/webgpu-claude-skill/blob/HEAD/skills/webgpu-threejs-tsl/SKILL.md
