Build with GLSL Shader.
Run a custom GLSL fragment shader over an image; the shader’s own uniforms become sliders, colour pickers and point controls
Best for
Run a custom GLSL fragment shader over an image; the shader’s own uniforms become sliders, colour pickers and point controls Use the playground to set up a single step, then open a workflow when you want to connect more tools.
Inputs explained
- Image (required)
- Set the image used by this model. Type: image.
Tips before you run
Start with the default settings and change one input at a time. Keep the result you like on your board so the next step can use it.
If you add a reference file, use a link the workflow can read. Check the inputs and credit estimate on the board before starting a run.
Working with this model
What it is for
A fragment shader is the smallest useful unit of image processing there is, and one node that runs an arbitrary one replaces a dozen single-purpose effect nodes. Vignette, grain, chromatic aberration, halftone, duotone, posterise, scanlines, bloom, a bespoke grade. All of them are a few lines of GLSL, and this node runs them on your wired image in the browser for free.
It is also the most agent-friendly node in the product: an LLM can write GLSL, so "give me a warm halftone with an adjustable dot size" is one prompt away from a working control panel.
The contract
You write a fragment shader BODY. The node declares these for you, so do not declare them yourself:
| Declared for you | What it is |
|---|---|
uniform sampler2D tex | The wired image |
uniform vec2 resolution | Output size in pixels |
in vec2 uvs | Texture coordinates, 0..1 |
out vec4 outColor | What you write your pixel to |
The #version line and the precision qualifiers are ours too. If you paste a
shader that carries its own #version, it is ignored rather than breaking the
compile.
The smallest shader that works:
void main() {
outColor = texture(tex, uvs);
}
Uniforms become controls
Every float, vec2 and vec3 uniform you declare turns into a control
in the editor, and its value is saved with the node.
| You declare | You get |
|---|---|
uniform float amount; | A slider, 0..1 |
uniform float amount; // min -2 max 2 | A slider, -2..2 |
uniform vec2 center; | An x / y pair |
uniform vec3 tint; | A colour picker |
Add default to the same comment to set the starting value:
// min 0 max 4 default 1.5, or // default #ff8800 for a colour.
Precision qualifiers are fine: uniform highp float amount; reads exactly
like the plain form.
If you give a range but no default, the control starts at the MIDDLE of it, so a pasted shader shows you its effect instead of previewing as a no-op.
Anything else is refused with a message rather than quietly ignored: arrays,
uniform float a, b; on one line, vec4, int, mat3, extra samplers.
A control the node cannot build is a uniform the node would never bind, and a
shader running on an unbound uniform is worse than one that will not save.
Two more things it will tell you about rather than swallow: a declaration missing its semicolon, and a block comment you never closed (which otherwise hides every declaration after it).
What you cannot do
#extension directives do not work. They have to precede everything else in
the unit, and the node's own declarations come first, so the driver rejects
them. Nothing outside core GLSL ES 3.0 is available.
There is one texture, tex, and no way to add a second, so multi-input
effects (blends, displacement maps) are out. The output is one image at the
source image's size.
Presets
Three shaders ship in the preset menu (vignette, film grain, chromatic aberration) plus a passthrough to start from. They are just source text: load one, then change it. There is nothing special about a preset once it is in your editor.
Errors
Compile errors appear under the source with the line numbers remapped onto YOUR lines, not the assembled ones. Save is disabled while any error is showing, and a shader that fails at full resolution writes nothing at all, so the node keeps serving its last good image instead of a blank one.
What it costs
Nothing. The shader runs on your own GPU and the result goes straight to storage. It is a free node, so it has no Run button; it refreshes with the rest of a workflow run.
Re-render needed
The output is stamped with the identity of the shader source, every uniform value, and the upstream image. Change any of them and the card shows Re-render needed. It keeps serving the previous image while that badge is up, deliberately: dropping it would fall back to the unshaded upstream photo, and a paid node downstream would then process the wrong image while looking perfectly healthy. Open the editor and save again to clear it.
Common questions
How do I use GLSL Shader on Wireflow?
Set the inputs above and choose Open in a workflow. Sign in to save your board, then check its credit estimate before you run.
Can I use GLSL Shader through an API?
Yes. Save a workflow with this model, then call the Wireflow run API with its workflow ID. The API tab has examples you can copy.
What changes the credit price?
The price shown uses the model defaults. Your inputs and model settings can change the total. The workflow shows an estimate before you run.
Can I connect this to another model?
Yes. Open it in a workflow and connect its output to another node with a matching input type.