Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
dgreenheck avatar

Webgpu Threejs Tsl

  • 932 installs
  • 1.1k repo stars
  • Updated April 10, 2026
  • dgreenheck/webgpu-claude-skill

webgpu-threejs-tsl is a frontend agent skill that teaches correct Three.js TSL compute shader patterns for developers building WebGPU GPU parallel workloads in JavaScript.

About

webgpu-threejs-tsl is a specialized skill from dgreenheck/webgpu-claude-skill focused on Three.js TSL compute shaders that run parallel GPU processing from JavaScript. Its core lesson is that TSL intercepts property assignments on nodes—such as `node.y = value`, `node.x.assign(value)`, and `buffer.element(i).assign(v)`—but cannot track JavaScript variable reassignment like `variable = variable.add(1)`. Developers reach for webgpu-threejs-tsl when Claude-powered agents emit broken TSL compute code that silently fails because agents confuse JS reassignment with TSL node mutation. The skill includes worked examples and a pattern compatibility table distinguishing property setters from invalid reassignment.

  • Teaches the critical difference between TSL node property assignment and JavaScript variable reassignment
  • Provides working patterns using property setters and .assign() calls that TSL can intercept
  • Shows exact failure modes when reassigning JS variables inside compute shader logic
  • Includes ready-to-use code examples for vec3 manipulation and buffer operations in compute shaders

Webgpu Threejs Tsl by the numbers

  • 932 all-time installs (skills.sh)
  • +34 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #411 of 2,245 Frontend Development skills by installs in the Skillselion catalog
  • Security screen: MEDIUM risk (skills.sh audit)
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/dgreenheck/webgpu-claude-skill --skill webgpu-threejs-tsl

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs932
repo stars1.1k
Security audit3 / 3 scanners passed
Last updatedApril 10, 2026
Repositorydgreenheck/webgpu-claude-skill

How do you write Three.js TSL compute shaders correctly?

Correctly write GPU compute shaders with Three.js TSL inside Claude-powered agents.

Who is it for?

Frontend developers building WebGPU compute pipelines in Three.js TSL who hit silent failures from JS reassignment anti-patterns.

Skip if: Teams using WebGL-only renderers, non-Three.js GPU frameworks, or backend compute without browser TSL nodes.

When should I use this skill?

A Three.js TSL or WebGPU compute task shows broken node updates, .assign() confusion, or JS variable reassignment in shader code.

What you get

Working TSL compute shader snippets, node assignment patterns, and GPU buffer update code compatible with WebGPU.

  • TSL compute shader snippet
  • Node assignment pattern reference
  • GPU buffer update code

By the numbers

  • Documents 4 TSL mutation patterns in its compatibility table

Files

SKILL.mdMarkdownGitHub ↗

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

Related skills

FAQ

Why does variable reassignment fail in Three.js TSL compute shaders?

webgpu-threejs-tsl explains TSL intercepts property assignments on nodes but cannot see JavaScript variable reassignment such as `variable = variable.add(1)`, so those updates never reach the GPU graph.

Which TSL update patterns work for compute buffers?

webgpu-threejs-tsl supports `node.y = value`, `node.x.assign(value)`, and `buffer.element(i).assign(v)` because TSL hooks property setters and explicit .assign() method calls.

Is Webgpu Threejs Tsl safe to install?

skills.sh reports 3 of 3 security scanners passed. Review the Security Audits panel on this page before installing in production.

Frontend Developmentagentsautomation

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.