Custom Nodes

Custom Function Nodes

Custom function nodes are entirely defined with code. They can either be inlined directly in the node, or imported from a file.

Inputs and outputs are automatically created by parsing the text. It is recommended to use in and out variables. Any variable type can be used, even if it's not supported by the graph, to pass values between custom functions. The last declared function in the file is used.

⚠️

Custom function parser is currently not very advanced. Some inputs and outputs might fail to parse, like using arrays etc. The function definition also has to be on one line.

To add custom function nodes to the graph search tree menu create an .hlsl and add a GraphlitFunction tag.

Binding Inputs

You can bind inputs, for example float2 UV would automatically pass in the uv0 texture coordinate to the function when input is not connected.

UVScaleCenter.hlsl
void UVScaleCenter(float2 UV, float Scale, out float2 Out)
{
    float s = 1-Scale;
    UV *= s;
    UV += 0.5 * Scale;
    Out = UV;
}

The list of binding names can be found in the PortBinding (opens in a new tab) enum. Some non-overridable bindings are not visible on the node.