Transient-Gated Emissivity: Making Pixels Scream
Transient-Gated Emissivity: Making Pixels Scream
Moving geometry to the beat is only half the battle. To make a visualizer feel genuinely aggressive (especially for genres like Breakcore or Techno), we have to manipulate the fragment shader's lighting model using audio transients.
The Standard Lighting Model
In a raymarcher, surface color is usually a combination of base albedo , Lambertian diffuse , and a Fresnel rim-light to highlight edges.
The problem: If you just scale by a smoothed audio envelope, the whole shape just gets brighter and darker. It lacks violence.
The Solution: The Overdrive Multiplier
We take a high-frequency transient metric—like Complex Spectral Difference (CSD), which measures phase-deviation in the audio signal to detect sharp, atonal hits—and use it as an overdrive multiplier squared or cubed.
Let be our sharp audio transient (normalized ).
By raising the transient to a power ( or ), we create a mathematical noise gate.
- When (quiet hi-hats), (essentially invisible).
- When (massive snare), .
The Fresnel term explodes in brightness only on the absolute hardest hits, and decays instantly. Because it is multiplied against , the flash only occurs on the grazing edges of the geometry, creating a sharp, localized electrical spark rather than washing out the entire screen.