abs
A function node that computes the component-wise absolute value of its input. It effectively 'flips' all negative values to be positive, while positive values remain unchanged.
Core Advantages
Its core advantage is creating symmetry and ensuring non-negativity in a simple, computationally cheap way. It's a fundamental building block for procedural patterns, UV mirroring effects, and specific animation behaviors like bouncing or pulsing.
Common Uses
UV Mirroring: Creating symmetrical mirroring effects across a texture's centerline using operations like `abs(uv.x - 0.5)`.
Pulsing/Bouncing Animation: Transforming a smooth oscillation like `sin(time)` into `abs(sin(time))` to create a continuous bouncing or pulsing animation.
Procedural Geometric Patterns: Used as a basis for generating diamond, checkerboard, and other patterns by combining the absolute values of UV coordinates.
Value Sanitization: Ensuring that certain intermediate calculation results (like intensity or masks) are non-negative to maintain their physical meaning.
How to adjust
The abs node itself has no adjustable parameters; its output effect is determined entirely by its input node. For example, inputting a `sin(time)` wave will produce a bouncing animation, whereas inputting processed UV coordinates will create visual mirroring or symmetrical patterns.
Code Examples
1// Remap UV.x from [0, 1] to [-1, 1], then take the absolute value
2// This creates a symmetrical 'V' shape gradient from the center
3const mirroredUvX = TSL.abs( uv.x.mul( 2 ).sub( 1 ) );