Nodes > Functions > Util > Custom Code
The Code Node allows custom GLSL shader functions to be written directly in the graph system. Code Nodes are powerful tools with many features, so be sure to check out the Code Node Guide for more information.
This Code Node is available in the Update container of a VFX graph. Code Nodes in VFX containers are the same as regular "floating" Code Nodes, except they allow for setting particle attributes directly, and output ports are blocked.
For quick reference on all the built-in operations available, select one of the code snippets from the Example Code dropdown.
To see more examples, check out the Code Node Template.
Inputs
Name | Type | Description |
---|---|---|
Value 1 | float | User-defined inputs appear on the left. This is the first input for the default example that appears when a Code Node is created |
Value 2 | float | User-defined inputs appear on the left. This is the second input for the default example that appears when a Code Node is created |
Properties
Name | Type | Description |
---|---|---|
Title | string | The title of your function. The title appears at the top of the Code Node and is used by the Custom Code Global node to select Global variables |
Version | string | The version of your custom function, useful to help keep track of code variants you create. The default value is 0.1.0 |
Stage | dropdown | For Code Nodes that are attached to Output containers in a VFX system, selects whether the Code Node is operating in the Vertex or Pixel shader |
Description | text | Optional description text to explain the Code Node’s function |
Errors | text | Errors in your code will appear in this window |
Example Code | dropdown | Load a premade code snippet, useful for quick reference of built-in functions. Selecting a code snippet will replace all the code in the code window |
Height | int | The height of the code window, in pixels |
Code | text | Custom shader functions are written here, and is where input and output ports and global variables are defined |
Was this page helpful?