warp_uv_md2

Function warp_uv_md2 

Source
fn warp_uv_md2(
    x: f32,
    y: f32,
    rad: f32,
    m: &PerVertexMotion,
    time: f32,
) -> [f32; 2]
Expand description

MilkDrop 2 warp UV formula.

Operates on normalized texture coordinates (x, y) ∈ [0, 1]². The output is the UV from which the fragment shader will sample prev_main.

Order of operations (matches butterchurn / projectM convention, which both derive from vis_milk2):

  1. Logarithmic zoom around (cx, cy), with curvature controlled by zoomexp.
  2. Rotation around (cx, cy) by rot radians.
  3. Anisotropic stretch around (cx, cy) by (sx, sy).
  4. Translation by (dx, dy) (subtractive — dx > 0 scrolls right).
  5. Optional sinusoidal warp displacement scaled by warp.