lessThan
Performs a 'less than' (<) comparison on two inputs, serving as a fundamental node for creating conditional logic and hard-edge masks.
Core Advantages
Encapsulates the low-level GLSL 'less than' operator into a clear, readable node. Its boolean output is the perfect input for driving conditional branches and creating hard-edge masks, serving as an atomic unit for all complex logic.
Common Uses
Creating sharp-edged masks, like circles, by comparing a distance to a radius.
Switching between different colors or effects based on conditions like vertex height or light intensity.
Discarding pixels based on an alpha or noise map value to create cutout or erosion effects.
Controlling animation phases by comparing the current time to a specific timestamp.
How to adjust
Adjustment is done by changing its input values, especially the threshold (input B). In the circular mask example, dynamically changing the radius threshold (input B) directly controls the size of the circular area on screen.
Code Examples
1// Calculate the distance from the pixel to the center
2const dist = length(uv().sub(vec2(0.5)));
3
4// Condition is true if the distance is less than the radius 0.3
5const inCircle = dist.lessThan(0.3);