or
Performs a logical OR operation, returning true if any of its input conditions are true. Used to merge multiple independent judgments.
Core Advantages
Common Uses
Merging multiple shape masks to create a 'union' of geometries, like combining a circle and a rectangle into one shape.
Aggregating procedural patterns, such as combining horizontal and vertical stripes to form a grid.
Defining complex conditional highlighting, like triggering an effect when 'health is low' OR 'is poisoned'.
How to adjust
Adjust by changing its input conditions. In the cross shape example, the `or` node adds all 'true' areas (the vertical and horizontal bands) to the final result. If you change the threshold of one condition (e.g., making the vertical band wider), the corresponding part of the final cross shape will also become wider.
Code Examples
1// Condition 1: Create a narrow vertical band
2const verticalBand = lessThan( abs( uv().x.sub( 0.5 ) ), 0.05 );
3
4// Condition 2: Create a narrow horizontal band
5const horizontalBand = lessThan( abs( uv().y.sub( 0.5 ) ), 0.05 );
6
7// Use 'or' to combine the conditions into a cross shape
8const crossShape = or( verticalBand, horizontalBand );