tsl
Installation
SKILL.md
Three.js Shading Language
Build version-matched TSL code and prove it through the repository's real renderer. Treat remembered APIs and this skill's examples as hypotheses until the installed Three.js package confirms them.
Ground the task
- Read the nearest
package.json, renderer setup, material or pass being changed, TypeScript configuration, and relevant tests. - Record the installed
threeand@types/threeversions. Inspect their exports, declarations, and shipped examples before inventing an import, cast, or workaround. - Preserve the existing renderer and public boundaries unless the request explicitly includes a migration. TSL is the right tool for a TSL/WebGPU task; it is not a reason to rewrite unrelated working GLSL or WebGL code.
- Identify the execution surface before coding:
| Surface | Start with |
|---|---|
| Material property or vertex deformation | nodes.md |
| Storage buffer or compute dispatch | compute.md |
| Fullscreen pass, MRT, depth, or neighboring samples | postprocessing.md |
Existing GLSL or ShaderMaterial migration |
migration.md |
| Type errors or source-path imports | typescript.md |
| Browser/GPU evidence | verification.md |