fract
fract
Returns the fractional part of the input, "wrapping" any number (or each component of a vector) into the `[0.0, 1.0)` range. It is fundamental for creating cyclic effects like tiling and looping.
Core Advantages
Provides a concise, efficient, and expressive node for creating repeating patterns and animation loops, avoiding the cumbersome and less readable `x - floor(x)` manual construction. It's a cornerstone of procedural texturing and animation.
Common Uses
Texture Tiling
Procedural Stripes/Grids
Animation Looping
How to adjust
Control the frequency of repetition by multiplying the input by a factor. For example, `fract(uv().x.mul(10))` produces 10 repeating gradient stripes, whereas `fract(uv().x)` produces only one.
Code Examples
1// Repeats UV coordinates 5 times within the [0, 1) range for texture tiling
2const tiledUV = fract( uv().mul( 5.0 ) );