oneMinus
oneMinus
Calculates the result of `1.0 - x`, commonly used to invert colors, masks, or values within the [0, 1] range.
Core Advantages
Encapsulates the common `1.0 - x` operation into a single node whose name clearly expresses the 'inversion' intent, making it more concise and readable than manually combining a constant and a subtraction node.
Common Uses
Inverting colors (negative effect)
Flipping masks to swap blended areas
Converting between PBR material attributes (e.g., roughness to glossiness)
How to adjust
Adjust the effect by changing its input node. For example, feeding a horizontal gradient (`uv().x`) into this node will result in a reversed, right-to-left gradient.
Code Examples
1// Invert a radial gradient that goes from black (center) to white (edge)
2const invertedGradient = oneMinus( radialGradient ); // Results in a white spot at the center