oscTriangle
oscTriangle
Generates a periodic triangle wave that moves back and forth between 0 and 1 at a constant rate. It's ideal for creating linear 'ping-pong' animations and V-shaped geometric patterns.
Core Advantages
Provides a constant-speed, back-and-forth change, perfect for simulating mechanical 'ping-pong' motion or linear gradient animations, and easily generates procedural geometric patterns like V-shapes or diamonds.
Common Uses
Linear ping-pong animation
V-shape/Chevron patterns
Audio visualization or beat effects
How to adjust
Control the frequency or pattern density by multiplying the input value (e.g., `uv().x` or `timerLocal()`). Combine horizontal and vertical triangle waves to create 2D patterns like diamonds.
Code Examples
1// Creates 10 horizontal V-shaped gradient stripes
2const vShapePattern = oscTriangle( uv().y.mul( 10 ) );