mx_ramplr
A function node for creating a horizontal linear gradient between two values, such as colors or floats.
Core Advantages
It simplifies gradient creation with a clearly named function (instead of manual mix logic) and is fully procedural, requiring no texture files, which ensures infinite resolution and flexibility.
Common Uses
Creating gradient backgrounds or mixing masks.
Simulating stylized side-lighting for Non-Photorealistic Rendering (NPR).
Acting as a control signal to drive other procedural effects, like hue shifts or thresholding.
How to adjust
Adjust by controlling the `valuel`, `valuer`, and `texcoord` inputs. Swapping the first two inputs reverses the gradient's direction; using non-color values (like `float`) creates a grayscale mask; replacing `texcoord` with `screenUV()` makes the gradient fixed to the screen space.
Code Examples
1
2// Define the start and end colors for the gradient
3const leftColor = color( 0xff0000 ); // Red
4const rightColor = color( 0x0000ff ); // Blue
5
6// Create a horizontal gradient from left (red) to right (blue)
7const rampNode = mx_ramplr( leftColor, rightColor );
8