GLNode
Write a fragment shader right on a node card, or pick a ready-made one for grading, blending, gradients, curves, resizing, per-pixel maths or even a sound's waveform. Then wire the picture anywhere.


After: A GLNode with Kind Custom drawing a 6 by 6 checker at 512 by 512 pixels, as the Texture of the block's TexturePack.
A GLNode is an image drawn by its Kind. Custom runs the GLSL you type on the card, and the rest are built in. Each uniform becomes an input. A sampler2D is a square you wire a picture into, and numbers, vectors and colours are attributes (gl:SetAttribute("Strength", 0.5)). It redraws at most once a frame, and only when something it reads changes. A GLSL error is marked on its line and drawn as red stripes. It runs wherever it sits.
Properties
GL
| Name | Type | Default | Description |
|---|---|---|---|
| Enabled | boolean | true | Off, the node renders transparent. |
| FragmentShader | string | ||
| Operation | string | ||
| Data | string | ||
| Position | string | Its own position in the graph of the NodeLayout it is a child of. | |
| Status | read-only text | Properties window only |
Advanced
| Kind | string | Custom Custom, Number Field Math, Color Field Math, Vector3 Field Math, Separate, Combine, Grade, Average, Sample, Min Max, Waveform, Spectrum, Color Curves, Bezier To Array, Luau Array, Resize, Solid Colour, Gradient, Blend | Which built-in kind draws the image; Custom draws with its code box. |
Scripts
| OutputSize | string | scripts only | Its picture's size: Largest uses the largest width and height of its square inputs, Input 1 the first one's size, Custom its own Size. |
Methods
| Name | Arguments | Returns | Description |
|---|---|---|---|
| GetImage | (sampler: string) | ImageContent? | Reads back the image picked for a sampler2D, not what a wire brings in. |
| SetImage | (sampler: string, image: ImageContent?) | () | Picks the image a sampler2D reads, like its picker in Properties; nil clears it, and a wire still wins. |
