Expand description
Smart boolean interpolation of motion params across a preset transition.
Once both slots’ per-frame equations have written fresh values into
their respective evaluator contexts, this module pulls the motion
params (zoom / rot / cx / cy / sx / sy / dx / dy /
warp) out of both contexts, lerps them linearly by the raw
transition progress, and pushes the same lerped values back into
both contexts. The downstream warp executor then sees an identical
starting state on both chains — what visually feels like a soft tug
between the two presets’ compositions.
Boolean flags (wrap, darken_center, invert, brighten, darken,
solarize) don’t lerp meaningfully — they snap from the outgoing
preset’s value to the incoming one’s at 50 % progress.
This is what MilkDrop calls “smart boolean interpolation”: floats morph, bools switch.
Constants§
- BOOL_
FLAGS 🔒 - Bool-ish flags that snap at the 50 % midpoint instead of lerping.
- MOTION_
DEFAULTS 🔒 - Default fallback per motion var when neither preset wrote it. Matches
the defaults that
super::state_sync::sync_render_stateapplies when reading the same vars out toRenderState.motion. - MOTION_
VARS 🔒 - Continuous motion params that lerp during a transition. Order is
load-bearing —
snapshot_motionand [write_motion] index into the returned array by position.
Functions§
- apply_
smart_ 🔒boolean_ interpolation - Lerp the motion params between the outgoing preset’s slot and the incoming one’s, then push the result into both evaluator contexts.
- snapshot_
flags 🔒 - snapshot_
motion 🔒 - write_
motion_ 🔒and_ flags