Three.js · TSL · WebGPU

Visual shader graphs for Three.js

Build TSL materials with nodes, like Unity Shader Graph. Save them as JSON in your project and load them with one line of code.

$ npm install tsl-material-graph three
Try the editor in your browser Read the docs See the showcase

The editor runs inside your own dev server: press Save and your scene updates instantly.

Everything you expect from a shader graph

A complete node editor for TSL, plus a tiny runtime. No shader code to write, no build step to configure.

Live previews on every node

See what each step of the graph produces, in 2D or on a sphere. Blackboard properties are uniforms: tweak a slider and everything updates without recompiling.

One-click arrange

A layered layout lines the graph up in columns, minimizes crossings and routes long connections through free lanes.

Fast to build

Drop a connection on empty space, type a name, press Enter: the node is created and connected. Groups, collapse, copy/paste and undo included.

Real WebGPU preview

The material is compiled with the real Three.js renderer (WebGL2 fallback). Invalid shaders are caught and reported, the preview keeps the last good one.

Up and running in three steps

Works with any Vite project. Not using Vite? Run npx tsl-material-graph instead.

1

Install

npm install tsl-material-graph three
2

Add the Vite plugin

import { shaderGraph } from 'tsl-material-graph/vite';

// vite.config.ts
plugins: [shaderGraph({ dir: 'src/shaders' })]
3

Edit and use

Open localhost:5173/__shadergraph/, save, then:

const shader = createShaderGraphMaterial(graph);
mesh.material = shader.material;
shader.set('Tint', '#ff5a2b');
Showcase of example materials

15 materials to start from

Every example is a live 3D scene rendered by the runtime: rotate it, then open it in the editor.

  • Classics: Hologram, Dissolve, Toon, Lava, Ocean, Marble, Wood, Force Field
  • Creative: Iridescent, Topographic, Pixel Planet, Radar, Neon Grid, Aurora, Thermal
Open the showcase

Make your first material

Free and open source (MIT). Requires Three.js r186 or later.

Get started Open the editor