oscSine
oscSine
Generates a smooth, periodic sine wave that oscillates between 0 and 1. It encapsulates common math logic, ideal for creating organic animations like 'breathing' or 'pulsing'.
Core Advantages
Provides a standardized, smooth [0, 1] signal, making it easy to create organic animations like pulsing or breathing without extra math, and its output is directly usable for color, alpha, or as a mix factor.
Common Uses
Pulsing light effects
Soft vertex animations
Smooth color transitions
How to adjust
Control the oscillation frequency (speed) by multiplying the input (e.g., `timerLocal()`), or adjust the phase (starting point) by adding to it. For example, `timerLocal().mul(2)` doubles the speed.
Code Examples
1// Create a smooth pulse value [0, 1] at twice the speed
2const pulse = oscSine( timerLocal().mul( 2 ) );