2026-03-17
What happened
Pulled shader logic into its own module (shaders.c). Shaders load from a directory at startup, indexed alphabetically. Each file is just a void main() body — the engine prepends a standard header that injects the uniforms: image_tex, audio_tex, fft_tex, uv, u_time, and u_p[15] for user parameters.
Three initial shaders beyond the default waveform overlay:
- spectrum.glsl — full-screen FFT bars with per-bin color and peak dots
- oscilloscope.glsl — glowing waveform trace drawn over the active image;
u_p[0]controls glow,u_p[1]amplitude,u_p[2]image blend - plasma.glsl — audio-reactive sine plasma;
u_p[0]drives speed from bass FFT,u_p[1]blends the source image underneath
Also added a shader_audio.lua patch that drives plasma parameters each frame from FFT bins — bass controls speed, high-mids control image blend.
Switching shaders is instant: vj.shader(i) from Lua, or /vj/shader i over OSC once that handler gets wired up.
commits: 015c7ae