Expand description
Main renderer assembling the per-frame Milkdrop pipeline.
Current pipeline (MVP):
- Warp pass — sample
prev_textureat the per-vertex warped UV (computed CPU-side by [onedrop-engine::warp_eval]) and write torender_texture, applying decay + feedback filters in the fragment shader. - Copy-to-prev —
render_texture→prev_textureso next frame’s warp pass can sample the previous frame’s content. - Comp pass — sample
render_texture, apply display-only filters (currently justgamma_adj; user comp shaders later in sprint B2), write tofinal_texture. Filters here intentionally don’t feed back into the warp loop.
final_texture is what render_texture() exposes to the GUI/CLI.
Future passes (waveforms, shapes, motion vectors, sprites, blur) compose on top of this foundation.
Structs§
- Milk
Renderer - Main Milkdrop renderer.
Constants§
- DEFAULT_
MESH_ COLS - Fallback warp mesh resolution. Used by call-sites that bypass
RenderConfig(tests, benches). The real default comes fromRenderConfig::mesh_cols/mesh_rows, whichMeshQuality::Mediumresolves to 48×36. MD2 ships 32×24 → 192×96. - DEFAULT_
MESH_ ROWS
Functions§
- build_
shader_ 🔒uniforms_ from - Build the
ShaderUniformspayload from anyRenderState+ GPU context. Shared between the primary and secondary render paths so each chain can run with its owngamma_adj/echo_alpha/ audio / q snapshot. - hue_
shader_ 🔒for - Time-driven RGB tint MD2 cycles through each frame. Three oscillators
with mutually-prime periods produce a slow rainbow rotation that
never repeats (rationals on the unit circle); presets that multiply
ret * hue_shaderget the rainbow rotation MD2 is tuned for, while presets that ignore it keep their authored colour palette because the per-channel output stays in[0, 1]and floats around~0.5..wis reserved for a future per-corner mix factor.