Understanding Waveforms
In game development, waveforms are just mathematical patterns that vary a value over time. You can apply them to, motion (position, rotation, scale), visual intensity (opacity, emission, glow) and blend factors (how one texture, color, or image mixes with another)
When used for blend modes, waveforms become a modulator, they repeatedly change how much of each layer is visible, and the shape of the waveform determines the transition’s feel.
In Quake 3, many shader functions use waveforms to modulate measurements over time. These days, it's still the same, except more things have become exposed to waveforms - namely lights and particle emitters.
In game development, 6 waveform shapes are often used:
- Sine
- Square
- Triangle
- Sawtooth
- Inverse-Sawtooth (not shown below, essentially a flipped version of Sawtooth)
- Noise (not shown below, pattern is randomly calculated. Often hard coded randomness algorithms)
Waveforms & Their Effect on Particle Paths and Blends
Sine Wave
Shape: Smooth, rounded oscillation. The sine way is a regular smoothly flowing wave function ranging from -1 to 1
Path effect: Creates natural, flowing motion (e.g., gentle sway, drifting smoke, floating sparks).
Blend effect: Creates smooth fades in and out between two visual states (e.g., fading particles between colors or textures). Perfect for effects like pulsing lights, breathing glow, or soft energy auras.
Why: The gradual acceleration/deceleration in a sine wave feels organic, ideal for non-mechanical transitions.
Square Wave
Shape: Instant jumps between two extremes. A square wave simply switches from -1 to 1 with no in-between
Path effect: Teleports or abruptly switches particle position/direction.
Blend effect: Creates an instant visual swap, no fading, just on/off or A/B. Perfect for glitch effects, blinking indicators, or strobe lights.
Why: The lack of transition emphasizes shock or urgency in the effect.
Triangle Wave
Shape: Linear rise and fall. Triangle is a wave with a sharp ascent and a sharp decay, ranging from 0 to 1. It will make choppy looking wave forms
Path effect: Produces steady zig-zag or back-and-forth movement without sudden speed changes.
Blend effect: Creates a steady crossfade between two visuals at a constant rate. Useful for mechanical transitions like scanning lasers or indicators that shift between states evenly.
Why: The uniform motion means the blend change feels consistent and predictable.
Sawtooth & Inverse-Sawtooth Wave
Shape: Gradual rise followed by an instant drop (or vice versa). In the sawtooth wave, the ascent is like a triangle wave from 0 to 1, but the decay cuts off sharply back to 0. The sawtooth sawtooth wave is an instant ascent to the peak value (1), then a triangle wave descent to the valley value (0). The phase on this goes from 1.0 to 0.0 instead of 0.0 to 1.0. This wave is particularly useful for additive cross-fades.
Path effect: Produces accelerating movement followed by a sudden reset, good for conveyor-like flows or dripping effects.
Blend effect: Gradually increases blend influence (e.g., a texture taking over) and then instantly resets. Great for effects like scanning wipes, buildup before an explosion, or “charging” visuals that snap back.
Why: Creates anticipation, then release.
Noise/Random
Shape: Irregular, unpredictable values.
Path effect: Causes chaotic, jittery movement (e.g., sparks, embers, electrical arcs).
Blend effect: Creates flickering or chaotic blending, like unstable energy, firelight, or glitch distortions.
Why: Adds realism or unpredictability by breaking repetition.
Waveform Examples
| Effect | Waveform (Path) | Path Animation | Waveform (Blend) | Blend Animation |
|---|