greaterThan
Performs a 'greater than' (>) comparison on two inputs, serving as a fundamental node for building conditional branches and threshold-based effects.
Core Advantages
It encapsulates the low-level GLSL 'greater than' operator into an intuitive, type-safe, and composable node, allowing developers to clearly express logical comparisons within the node graph without worrying about implementation details.
Common Uses
Implementing hard thresholding by comparing a continuous signal (like a grayscale value) to a threshold, generating a black-and-white mask.
Serving as the conditional input for a `cond` node to create if-else logic, switching colors or effects based on the condition.
Easily creating procedural repeating patterns like stripes and grids by comparing the results of functions such as `sin` or `fract`.
Triggering state changes or one-shot events in animations by comparing the current time against a specific timestamp.
How to adjust
Adjustment is done by changing its inputs, particularly the threshold input (B). For example, when comparing a left-to-right gradient (input A) against a variable threshold (input B), dynamically changing the threshold value creates a 'wipe' or 'reveal' effect, causing a dividing line to move smoothly across the surface.
Code Examples
1// Create a series of vertical black and white stripes
2const stripes = greaterThan( sin( uv().x.mul(30) ), 0 );