Introduction
This document describes the built-in Flow Graph modules of the following categories for shaders:
- Shaders: Math / Vector - Modules that compute vector geometry and convert between packed and split vector component layouts.
- Shaders: Math / Array - Modules that read scalar, vector, and color values from shader arrays by index.
- Shaders: Math / Color - Modules that blend, convert, split, merge, and transform shader color values between common representations.
- Shaders: Math / Transformation - Modules that split, merge, concatenate, scale, transpose, and apply transformation matrices to shader vectors.
Shaders: Math / Vector
This section describes the built-in Flow Graph modules that compute vector geometry and convert between packed and split vector component layouts.
Abs Max Component
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Finds the component with the largest absolute magnitude.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Maximum (scalar) - Original component value with the largest absolute magnitude.
- ⏺ Index (integer) - Component index of Maximum (0 for X, 1 for Y, 2 for Z, 3 for W).
Convex
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Normalizes vector components by their total sum.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Out (vector) - Input divided by the sum of all components, or zero when the sum is zero.
Cross
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the 3D cross product of two vectors.
- Input pins:
- ⏺ A (vector) - First vector input.
- ⏺ B (vector) - Second vector input.
- Output pins:
- ⏺ Out (vector) - Cross product of A and B using XYZ components.
Direction
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Builds a normalized direction vector from one point to another.
- Input pins:
- ⏺ A (vector) - Start point.
- ⏺ B (vector) - End point.
- Output pins:
- ⏺ Out (vector) - Normalized direction from A to B.
Distance
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the distance between two vectors.
- Input pins:
- ⏺ A (vector) - First vector position.
- ⏺ B (vector) - Second vector position.
- Output pins:
- ⏺ Out (scalar) - Distance between A and B.
Dot
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the dot product of two vectors.
- Input pins:
- ⏺ A (vector) - First vector input.
- ⏺ B (vector) - Second vector input.
- Output pins:
- ⏺ Out (scalar) - Dot product of A and B.
Face Center
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the center point of a triangle face.
- Input pins:
- ⏺ Point 1 (vector) - First triangle point.
- ⏺ Point 2 (vector) - Second triangle point.
- ⏺ Point 3 (vector) - Third triangle point.
- Output pins:
- ⏺ Out (vector) - Average position of the three points.
Face Normal
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the normal vector of a triangle face.
- Input pins:
- ⏺ Point 1 (vector) - First triangle point.
- ⏺ Point 2 (vector) - Second triangle point.
- ⏺ Point 3 (vector) - Third triangle point.
- Output pins:
- ⏺ Out (vector) - Normalized face normal from the three points.
Length
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes the length of a vector.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Out (scalar) - Vector length.
Merge
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Builds a vector from X, Y, Z, and W components.
- Input pins:
- ⏺ X (scalar) - X component input.
- ⏺ Y (scalar) - Y component input.
- ⏺ Z (scalar) - Z component input.
- ⏺ W (scalar) - W component input.
- Output pins:
- ⏺ Out (vector) - Vector assembled from X, Y, Z, and W.
Merge XY-Z-W
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Builds a vector from XY, Z, and W inputs.
- Input pins:
- ⏺ XY (vector) - Source vector for X and Y components.
- ⏺ Z (scalar) - Z component input.
- ⏺ W (scalar) - W component input.
- Output pins:
- ⏺ Out (vector) - Vector assembled from XY, Z, and W.
Merge XY-ZW
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Builds a vector from XY and ZW pairs.
- Input pins:
- ⏺ XY (vector) - Source vector for X and Y components.
- ⏺ ZW (vector) - Source vector for Z and W components.
- Output pins:
- ⏺ Out (vector) - Vector assembled from XY and ZW.
Merge XYZ-W
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Builds a vector from XYZ and W inputs.
- Input pins:
- ⏺ XYZ (vector) - Source vector for X, Y, and Z components.
- ⏺ W (scalar) - W component input.
- Output pins:
- ⏺ Out (vector) - Vector assembled from XYZ and W.
Normalize
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Normalizes a vector to unit length.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Out (vector) - Normalized direction of In.
Plane Distance
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Computes signed distance from a point to a plane.
- Input pins:
- ⏺ Plane (vector) - Plane coefficients.
- ⏺ Point (vector) - Point to measure.
- Output pins:
- ⏺ Out (scalar) - Signed distance of Point from Plane.
Reflect
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Reflects an incident direction around a surface normal.
- Input pins:
- ⏺ Incident (vector) - Incoming direction vector.
- ⏺ Normal (vector) - Surface normal vector.
- Output pins:
- ⏺ Out (vector) - Reflected direction from Incident and Normal.
Refract
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Refracts an incident direction through a surface.
- Input pins:
- ⏺ Incident (vector) - Incoming direction vector.
- ⏺ Normal (vector) - Surface normal vector.
- ⏺ Refr Index (scalar) - Refraction index ratio.
- Output pins:
- ⏺ Out (vector) - Refracted direction from Incident, Normal, and RefrIndex.
Section 2D Intersection
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Tests whether two 2D line segments intersect.
- Input pins:
- ⏺ A (vector) - Start point of the first segment.
- ⏺ B (vector) - End point of the first segment.
- ⏺ C (vector) - Start point of the second segment.
- ⏺ D (vector) - End point of the second segment.
- Output pins:
- ⏺ Found (logical) - On when the two segments intersect.
- ⏺ Factor (scalar) - Intersection position along AB, where 0 is A and 1 is B.
Split
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Splits a vector into X, Y, Z, and W components.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ X (scalar) - X component of In.
- ⏺ Y (scalar) - Y component of In.
- ⏺ Z (scalar) - Z component of In.
- ⏺ W (scalar) - W component of In.
Split XY-Z-W
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Splits a vector into XY, Z, and W outputs.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ XY (vector) - X and Y components packed into a vector.
- ⏺ Z (scalar) - Z component of In.
- ⏺ W (scalar) - W component of In.
Split XY-ZW
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Splits a vector into XY and ZW pairs.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ XY (vector) - X and Y components packed into a vector.
- ⏺ ZW (vector) - Z and W components packed into a vector.
Split XYZ-W
- Category: Shaders: Math / Vector
- Access: All editions.
- Function: Splits a vector into XYZ and W outputs.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ XYZ (vector) - X, Y, and Z components packed into a vector.
- ⏺ W (scalar) - W component of In.
Shaders: Math / Array
This section describes the built-in Flow Graph modules that read scalar, vector, and color values from shader arrays by index.
Array Color
- Category: Shaders: Math / Array
- Access: All editions.
- Function: Reads three consecutive scalars from a shader array and builds an RGB color.
- Input pins:
- ⏺ In (array) - The source value
- ⏺ Start Index (integer) - Zero-based index of the first element; the next two indices supply the remaining color channels.
- Output pins:
- ⏺ Out (color) - RGB color from three consecutive array elements.
Array Scalar
- Category: Shaders: Math / Array
- Access: All editions.
- Function: Reads one scalar from a shader array at the given index.
- Input pins:
- ⏺ In (array) - The source value
- ⏺ Index (integer) - Zero-based index of the element to output.
- Output pins:
- ⏺ Out (scalar) - Scalar value stored at Index.
Array Vector
- Category: Shaders: Math / Array
- Access: All editions.
- Function: Reads four consecutive scalars from a shader array and packs them into one vector.
- Input pins:
- ⏺ In (array) - The source value
- ⏺ Start Index (integer) - Zero-based index of the first element; the next three indices are read as well.
- Output pins:
- ⏺ Out (vector) - Vector built from four consecutive array elements (X, Y, Z, W).
Array Vector XY
- Category: Shaders: Math / Array
- Access: All editions.
- Function: Reads two consecutive scalars from a shader array and outputs them as X and Y with Z and W set to zero.
- Input pins:
- ⏺ In (array) - The source value
- ⏺ Start Index (integer) - Zero-based index of the first element; the next index is read as the second component.
- Output pins:
- ⏺ Out (vector) - Vector with X and Y from the array and Z and W set to zero.
Array Vector XYZ
- Category: Shaders: Math / Array
- Access: All editions.
- Function: Reads three consecutive scalars from a shader array and outputs them as X, Y, and Z with W set to zero.
- Input pins:
- ⏺ In (array) - The source value
- ⏺ Start Index (integer) - Zero-based index of the first element; the next two indices are read as the remaining components.
- Output pins:
- ⏺ Out (vector) - Vector with X, Y, and Z from the array and W set to zero.
Shaders: Math / Color
This section describes the built-in Flow Graph modules that blend, convert, split, merge, and transform shader color values between common representations.
Alpha Merge
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Combines RGB color and opacity into one vector output.
- Input pins:
- ⏺ Color (color) - RGB color for the output.
- ⏺ Opacity (scalar) - Opacity stored in the output W channel.
- Output pins:
- ⏺ Out (vector) - Vector with RGB in X–Y–Z and Opacity in W.
Alpha Split
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Splits a vector color into RGB and a separate opacity.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Color (color) - RGB taken from the input (channels X, Y, Z).
- ⏺ Opacity (scalar) - Opacity taken from the W channel of the input.
Blend
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Blends foreground RGB over background RGB using a selectable blend mode, then mixes toward that result by foreground opacity.
- Input pins:
- ⏺ Blending Mode (integer, Blending Mode) - Selects how foreground and background RGB are combined before opacity mixing.
- ⏺ Background (color) - Background RGB color.
- ⏺ Foreground (color) - Foreground RGB color blended against the background.
- ⏺ Fg Opacity (scalar) - How much of the blended result is applied (0 leaves the background, 1 applies the full blend).
- Output pins:
- ⏺ Out (color) - Resulting RGB after blending and foreground opacity.
Blend Mix
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Blends foreground and background RGB with a selectable mode, then resolves combined color and opacity for layered compositing.
- Input pins:
- ⏺ Blending Mode (integer, Blending Mode) - Selects how foreground and background RGB are combined.
- ⏺ Background (color) - Background RGB color.
- ⏺ Bg Opacity (scalar) - Opacity applied to the background contribution.
- ⏺ Foreground (color) - Foreground RGB color.
- ⏺ Fg Opacity (scalar) - Opacity applied to the foreground contribution.
- Output pins:
- ⏺ Color (color) - RGB after the blend and opacity mix.
- ⏺ Opacity (scalar) - Opacity accompanying the Color output.
Color Compose
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Builds an RGB color from hue, saturation, and brightness using either HSV or HSL.
- Input pins:
- ⏺ Hue (scalar) - Hue for the output color.
- ⏺ Saturation (scalar) - Saturation for the output color.
- ⏺ Brightness (scalar) - Value (HSV) or lightness (HSL), depending on Space.
- ⏺ Space (integer, HSB Space) - Selects whether Brightness is interpreted as HSV value or HSL lightness.
- Output pins:
- ⏺ Out (color) - RGB color reconstructed from the three components.
Color Decompose
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Splits RGB into hue, saturation, and brightness using either HSV or HSL.
- Input pins:
- ⏺ In (color) - The source value
- ⏺ Space (integer, HSB Space) - Selects HSV (value) or HSL (lightness) for the third component.
- Output pins:
- ⏺ Hue (scalar) - Hue from the selected space.
- ⏺ Saturation (scalar) - Saturation from the selected space.
- ⏺ Brightness (scalar) - Value (HSV) or lightness (HSL), depending on Space.
Color Dim
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Scales an RGB color by a single intensity factor.
- Input pins:
- ⏺ Color (color) - Input RGB color.
- ⏺ Intensity (scalar) - Multiplier applied to each RGB channel.
- Output pins:
- ⏺ Out (color) - RGB color scaled by Intensity.
Color From Linear
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Encodes linear RGB through the selected transfer curve (gamma / log) for display-style RGB.
- Input pins:
- ⏺ In (color) - The source value
- ⏺ Gamma Function (integer, RGB Gamma) - Transfer curve applied to encode linear RGB.
- Output pins:
- ⏺ Out (color) - Encoded RGB after the selected curve.
Color Gray Level
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Computes a single brightness value from an RGB color.
- Input pins:
- ⏺ In (color) - The source value
- Output pins:
- ⏺ Brightness (scalar) - Brightness derived from the RGB channels.
Color Merge
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Builds one RGB color from separate red, green, and blue inputs.
- Input pins:
- ⏺ Red (scalar) - Red channel value.
- ⏺ Green (scalar) - Green channel value.
- ⏺ Blue (scalar) - Blue channel value.
- Output pins:
- ⏺ Out (color) - RGB color assembled from the three channels.
Color Multiply
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Multiplies two RGB colors component-wise.
- Input pins:
- ⏺ A (color) - First RGB color.
- ⏺ B (color) - Second RGB color.
- Output pins:
- ⏺ Out (color) - RGB product of A and B per channel.
Color Split
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Splits an RGB color into separate red, green, and blue channel values.
- Input pins:
- ⏺ In (color) - The source value
- Output pins:
- ⏺ Red (scalar) - Red channel of In.
- ⏺ Green (scalar) - Green channel of In.
- ⏺ Blue (scalar) - Blue channel of In.
Color To Linear
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Decodes display-style RGB through the selected transfer curve (gamma / log) to linear RGB.
- Input pins:
- ⏺ In (color) - The source value
- ⏺ Gamma Function (integer, RGB Gamma) - Transfer curve assumed when decoding to linear RGB.
- Output pins:
- ⏺ Out (color) - Linear RGB after the inverse of the selected curve.
Color Transform
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Applies a linear color transformation matrix to RGB.
- Input pins:
- ⏺ In (color) - The source value
- ⏺ Transformation (transformation) - Row-major 4×3 matrix applied as RGB with an implicit 1 for the homogeneous coordinate.
- Output pins:
- ⏺ Out (color) - Transformed RGB color.
From SRGB
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Converts sRGB-encoded RGB to linear RGB.
- Input pins:
- ⏺ In (color) - The source value
- Output pins:
- ⏺ Out (color) - Linear RGB decoded from sRGB.
To SRGB
- Category: Shaders: Math / Color
- Access: All editions.
- Function: Converts linear or scene RGB to the sRGB display encoding.
- Input pins:
- ⏺ In (color) - The source value
- Output pins:
- ⏺ Out (color) - RGB encoded for sRGB.
Shaders: Math / Transformation
This section describes the built-in Flow Graph modules that split, merge, concatenate, scale, transpose, and apply transformation matrices to shader vectors.
Inverse Transpose
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Gives the inverse-transpose of the linear part of the input transformation (translation cleared).
- Input pins:
- ⏺ In (transformation) - The source value
- Output pins:
- ⏺ Out (transformation) - Derived transform with adjusted linear rows and translation cleared.
Transform
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Moves a 3D point according to a transformation.
- Input pins:
- ⏺ In (vector) - The source value
- ⏺ Transformation (transformation) - Affine transform applied as a row-vector multiply with homogeneous w = 1.
- Output pins:
- ⏺ Out (vector) - Transformed XYZ with W set to 0.
Transform Dir
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Turns a direction or offset through a transformation without applying its shift.
- Input pins:
- ⏺ In (vector) - The source value
- ⏺ Transformation (transformation) - Affine transform; only its 3×3 linear block affects the output.
- Output pins:
- ⏺ Out (vector) - Linearly transformed XYZ with W set to 0.
Transform Homog
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Applies a full homogeneous transformation to a four-component vector.
- Input pins:
- ⏺ In (vector) - The source value
- ⏺ Transformation (homogeneous space transformation) - Homogeneous 4×4 matrix applied to In.
- Output pins:
- ⏺ Out (vector) - Full homogeneous result including W.
Transform XY
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Places and rotates values in 2D using scale, angle, and offset.
- Input pins:
- ⏺ In (vector) - The source value
- ⏺ Position (vector) - Translation added to the rotated XY components.
- ⏺ Rotation (scalar) - Rotation angle in degrees in the XY plane before translation.
- ⏺ Scale (vector) - Per-axis scale factors for In.xy before rotation; Z and W are unused.
- Output pins:
- ⏺ Out (vector) - Transformed XY with Z and W set to 0.
Transformation Concat
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Combines two transformations into a single chained result.
- Input pins:
- ⏺ A (transformation) - First affine factor applied in the composition.
- ⏺ B (transformation) - Second affine factor applied after A in the composition.
- Output pins:
- ⏺ Out (transformation) - Product of A (expanded to 4×4 with bottom row 0, 0, 0, 1) and B as a 4×3 affine map.
Transformation Merge
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Builds one transformation from a position and three axis directions.
- Input pins:
- ⏺ Position (vector) - Translation written to the fourth row (XYZ).
- ⏺ Forward (vector) - Forward axis written to the third row (XYZ).
- ⏺ Up (vector) - Up axis written to the second row (XYZ).
- ⏺ Right (vector) - Right axis written to the first row (XYZ).
- Output pins:
- ⏺ Transformation (transformation) - Affine transform assembled from Right, Up, Forward, and Position.
Transformation Scaling
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Extracts the scaling of the transformation.
- Input pins:
- ⏺ Transformation (transformation) - The source value
- Output pins:
- ⏺ Scaling (vector) - Per-axis lengths of the right, up, and forward rows in X, Y, and Z; W is 0.
Transformation Split
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Splits a transformation into its position and three axis directions.
- Input pins:
- ⏺ Transformation (transformation) - The source value
- Output pins:
- ⏺ Position (vector) - Translation taken from the fourth row (XYZ).
- ⏺ Forward (vector) - Forward axis direction taken from the third row (XYZ).
- ⏺ Up (vector) - Up axis direction taken from the second row (XYZ).
- ⏺ Right (vector) - Right axis direction taken from the first row (XYZ).
Transpose
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Gives the transpose of the linear part of the input transformation (translation cleared).
- Input pins:
- ⏺ In (transformation) - The source value
- Output pins:
- ⏺ Out (transformation) - Transform with transposed linear part and translation cleared.
Unhomog
- Category: Shaders: Math / Transformation
- Access: All editions.
- Function: Turns a projected homogeneous vector into an ordinary 3D position.
- Input pins:
- ⏺ In (vector) - The source value
- Output pins:
- ⏺ Out (vector) - XYZ after division by W, with output W set to 0.