webgpu-tsl-3dlisted
Install: claude install-skill RaveenDi/Skilloadout
# WebGPU & TSL for Next-Gen Web 3D
WebGPU unlocks **compute shaders** — millions of particles, fluid/cloth simulations, GPU culling —
while TSL lets you write shaders once in JavaScript that compile to WGSL (WebGPU) and GLSL (WebGL 2 fallback).
## Setup
```js
import * as THREE from "three/webgpu"; // WebGPU build (includes node materials)
import { color, uv, time, sin, positionLocal, mix, vec3, uniform, Fn, instanceIndex, storage, hash } from "three/tsl";
const renderer = new THREE.WebGPURenderer({ antialias: true });
await renderer.init(); // required before first render/compute
renderer.setPixelRatio(Math.min(devicePixelRatio, 1.5));
// Automatically falls back to a WebGL 2 backend when WebGPU is unavailable.
```
Check `renderer.backend.isWebGPUBackend` to enable compute-heavy features only on WebGPU.
## TSL node materials
```js
const uProgress = uniform(0); // drive from scroll
const mat = new THREE.MeshStandardNodeMaterial();
const wave = sin(positionLocal.y.mul(6).add(time.mul(2))).mul(0.05).mul(uProgress);
mat.positionNode = positionLocal.add(vec3(wave, 0, wave));
mat.colorNode = mix(color("#1b1f3a"), color("#ff7a45"), uv().y.add(wave.mul(4)));
mat.roughnessNode = uProgress.oneMinus().mul(0.6).add(0.2);
```
- Nodes are composable functions: build a small library (`noise3`, `fresnel`, `dissolveMask`) and reuse them across materials.
- Update uniforms from JS each frame (`uProgress.value = damped`), never reb