oscSawtooth
oscSawtooth
Generates a periodic sawtooth wave signal that linearly ramps from 0 to 1 and then instantly resets. It's an alias for `fract(x)`, used for creating procedural gradients and repeating animations.
Core Advantages
Generates procedural gradients with precisely controllable frequency without needing textures, and provides a fundamental 'linear ramp-instant reset' rhythm for animations like scanning and scrolling.
Common Uses
Procedural stripe patterns
UV animation and texture scrolling
Sci-fi scanline or energy shield effects
How to adjust
Control the frequency by multiplying the input value (e.g., `uv().x` or `timerLocal()`). A larger multiplier increases the pattern density or animation speed.
Code Examples
1const sawtoothPattern = oscSawtooth( uv().x.mul( 10 ) );
2
3// Creates 10 vertical black-to-white gradient stripes