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.

A low granite plinth on a paved patio before a sunlit cream plaster wall, blue sky above, mid afternoon sun from the front left; an off white block and an off white ball stand on the plinth in the plain look.
Before
The same frame with a GLNode on the block, which turns to a teal and cream checker with an orange dot in each square, the ball unchanged.
After

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

NameTypeDefaultDescription
EnabledbooleantrueOff, the node renders transparent.
FragmentShaderstring
Operationstring
Datastring
PositionstringIts own position in the graph of the NodeLayout it is a child of.
Statusread-only textProperties window only

Advanced

KindstringCustom
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

OutputSizestringscripts onlyIts 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

NameArgumentsReturnsDescription
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.
From GlslSource 1
From BaseImageContent 9
From Instance 22