Generator node

Live Shader

Write Metal directly in Grafit. Every input you declare in the shader’s header becomes a port, so anything in the graph can drive it — audio, motion, an LFO, another shader. Compilation happens off the render thread and the last working version keeps drawing until the new one passes, so a mistake pauses your work instead of blanking the output.

Inputs

PortTypeDefault
EnableOff stops the shader drawing; the compiled pipeline stays loaded, so turning it back on is instant.booltrue

Outputs

PortType
Imageimage
Widthfloat
Heightfloat
Compiledbool

How It Works

Live Shader puts Metal itself in the graph. You write a fragment shader, and every input declared in the shader's header becomes a port — so audio, motion, an LFO, a tracked hand or another shader can drive it.

Compilation happens off the render thread, and the last working version keeps drawing until the new one passes, so a typo pauses your work instead of blanking the output. Four safety layers stand between an edit and the GPU: a static pre-scan, a smoke test, a runtime fault guard that bypasses the node after three faults, and honest resource limits. A shader chunk library (noise, easing, constants) can be #included, with every file's provenance recorded.

Editing happens in the Shader Editor — a floating panel (⌥⌘E, double-click the node, or Open Editor in Settings) bound to one Live Shader by id, so it stays on your shader while you select, cable and inspect other nodes. Inside it: Metal syntax colouring written in-house, errors as you type (the compiler front end runs 400 ms after the last keystroke and underlines the line), Auto apply, completion after u., p. and in., an outline of inputs, includes and functions, a live sidebar showing the current value of every declared input at 30 Hz, and a thumbnail of the shader's own output. Four templates — generator, image filter, SDF shapes, audio reactive — give a compiling starting point.

Every Live Shader carries a compile dot in its node header: green, yellow, red, or orange for bypassed.

Use Cases

  • An effect Grafit does not have — Write it, declare its parameters in the header, and it behaves like any other node.
  • Audio-reactive shaders — Band levels from Spectrum into declared inputs; the audio-reactive template is the starting point.
  • Image filters — Take an image port in and return a processed one; the filter template wires that up.
  • Material for a mesh — A Live Shader's output cabled into a 3D Scene Mesh's Texture or Normal Map is one connection.
  • Teaching and prototyping — The fastest loop from an idea in MSL to a picture, with errors shown as you type.

Tips

  • The header's NAME becomes the node's name in the graph — name your shaders and the patch reads itself.
  • Add input writes a correct header line for you; getting the header syntax right by hand is the usual stumbling block.
  • Auto apply installs every edit that lints clean, but holds port changes until the header has been quiet for a moment — so a half-typed input never removes a cable.
  • A saved project now compiles its shaders on load, and uncompiled text is saved with the project. Neither used to be true.
  • If the node goes orange it has been bypassed after repeated faults; fix the shader and recompile to bring it back.
  • Reveal in the panel jumps the graph to the node, which matters once a project has several shaders.

Open Live Shader in the interactive catalog →

Live Shader is one of 381 nodes in Grafit Pro.

Free download. Every feature for 7 days, no card. Then €99.99 once — or keep playing your projects as a Player.

More Generator nodes