TSL Material Graph: a visual shader graph editor for TSL (Unity Shader Graph style)

hot-reload

Hi everyone!

I’ve been using TSL a lot since the WebGPU renderer landed, and the one thing I kept missing from Unity and Unreal was a visual shader graph. So I built one, and it’s now on npm.

preview

What it is

- A node editor for TSL materials: 60+ nodes (math, noise, Voronoi, Fresnel, UV tools, texture sampling, vertex displacement…)

- Live previews on every node, rendered with the real WebGPURenderer (WebGL2 fallback included)

- A Blackboard of properties that become uniforms in your code: shader.set('Tint', '#ff5a2b') updates without recompiling

- A tiny runtime (about 27 KB) that turns the saved JSON into a regular NodeMaterial

How it fits in a project

npm install tsl-material-graph three

// vite.config.ts

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

export default defineConfig({ plugins: [shaderGraph({ dir: 'src/shaders' })] });

Run npm run dev and the editor is at /__shadergraph/ on your own dev server. Save writes the JSON into src/shaders, and with Vite’s hot reload your scene picks up the change immediately.

import graph from './shaders/Lava.json';

const shader = createShaderGraphMaterial(graph);

mesh.material = shader.material;

live-edit

Quality of life: one-click auto layout (ELK) that routes long connections around nodes, groups, collapsible nodes, copy/paste, undo/redo, and invalid shaders are caught before they reach your material.

arrange

Try it without installing anything:

- Showcase with 15 live materials (dissolve, toon, lava, ocean, iridescent, pixel planet, aurora…): Showcase · TSL Material Graph

- Editor in the browser: TSL Material Graph

- Docs: Docs · TSL Material Graph

It’s MIT and still early (0.1). I’d love to know which nodes you miss most, and what would make it fit your workflow. Thanks for having a look!

1 Like