Skip to main content

FrameInput

Struct FrameInput 

Source
pub struct FrameInput {
Show 30 fields pub time: f64, pub fps: f32, pub frame: u32, pub progress: f32, pub bass: f32, pub mid: f32, pub treb: f32, pub bass_att: f32, pub mid_att: f32, pub treb_att: f32, pub imm_abs: [f32; 3], pub q: [f32; 32], pub rand_frame: [f32; 4], pub rand_preset: [f32; 4], pub warp_uv: Option<Vec<[f32; 2]>>, pub warp_gpu: Option<WarpGpu>, pub post: PostParams, pub blur: BlurParams, pub borders: Borders, pub mv: MotionVectors, pub main_wave: MainWave, pub shapes: Vec<ShapeInstance>, pub waves: Vec<CustomWave>, pub darken_center: bool, pub warp_random: Option<PassRandom>, pub comp_random: Option<PassRandom>, pub hue_offsets: Option<[f32; 4]>, pub md2_blend: Option<Md2Blend>, pub ext: ShaderExt, pub sprites: Vec<SpriteDraw>,
}
Expand description

Per-frame values after per-frame equations.

Fields§

§time: f64

GetTime() (== time var, _c2.x). Frame n is exactly n / fps.

§fps: f32

GetFps() (fps, _c2.y).

§frame: u32

GetFrame() (frame, _c2.z).

§progress: f32

progress (_c2.w): (time - preset_start) / (next_preset_time - preset_start).

§bass: f32

mysound.imm_rel[0..3] = bass, mid, treb (_c3.xyz).

§mid: f32

mysound.imm_rel[1] = mid.

§treb: f32

mysound.imm_rel[2] = treb.

§bass_att: f32

mysound.avg_rel[0..3] = bass_att, mid_att, treb_att (_c4.xyz).

§mid_att: f32

mysound.avg_rel[1] = mid_att.

§treb_att: f32

mysound.avg_rel[2] = treb_att.

§imm_abs: [f32; 3]

mysound.imm[0..3] (absolute, un-normalised). Only used by main-wave mode 3 (alpha *= pow(treble_rel, 2) where MD2 reads mysound.imm[2]).

§q: [f32; 32]

q1..q32 after per-frame code (_qa.._qh).

§rand_frame: [f32; 4]

m_rand_frame (rand_frame): four FRANDs drawn once per frame.

§rand_preset: [f32; 4]

m_pState->m_rand_preset (rand_preset): four FRANDs drawn once per preset.

§warp_uv: Option<Vec<[f32; 2]>>

Final UV of every warp-mesh vertex, (gx+1)*(gy+1) entries, row 0 first (clip y = -1); a different length is rejected by Renderer::render_frame. Build with crate::warp_mesh. None = no motion (zoom 1, no warp), except with warp_gpu under projectM’s compat rules, where the GPU computes the UVs and the renderer derives this grid from warp_gpu only if a motion vector lookup needs it. The UVs are also what the next frame’s motion vectors read, and what the MilkDrop 2 compat paths draw.

§warp_gpu: Option<WarpGpu>

Per-vertex inputs of projectM’s warp vertex shader: with Compat::ProjectM the renderer lets the GPU evaluate the warp UV formula (pow/sin/cos are GPU approximations, not libm, so the result is only reproducible on the GPU) from these instead of using warp_uv; vars must then have one entry per mesh vertex. None = use warp_uv.

§post: PostParams

Decay and composite-pass controls.

§blur: BlurParams

Blur-chain parameters.

§borders: Borders

Outer / inner borders.

§mv: MotionVectors

Motion-vector field.

§main_wave: MainWave

Main waveform.

§shapes: Vec<ShapeInstance>

Custom shapes in draw order (m_shape[0..16], each instance already evaluated).

§waves: Vec<CustomWave>

Custom waves in draw order (m_wave[0..16], per-point equations already evaluated).

§darken_center: bool

var_pf_darken_center.

§warp_random: Option<PassRandom>

Random state of the warp / composite shader pass (override of rand_frame / rand_preset above and of the renderer’s rotation matrices); None = use the fields above.

§comp_random: Option<PassRandom>

Random state of the composite shader pass, see warp_random.

§hue_offsets: Option<[f32; 4]>

Phases of the four hue-shader corner colours (m_fRandStart / projectM hueRandomOffsets); None = the renderer’s per-preset values.

§md2_blend: Option<Md2Blend>

MilkDrop 2’s preset blend (m_bBlending) in progress (CompatRules::md2_preset_blend): the fields above are then the new state’s blended values and this carries the rest, see Md2Blend. None = no blend.

§ext: ShaderExt

MilkDrop 3 shader inputs (_c14, _qi.._qp, shader time, FFT); neutral outside MilkDrop 3.

§sprites: Vec<SpriteDraw>

MilkDrop 3 preset sprites to draw this frame (see crate::sprite::SpriteDraw::layer for where each goes); empty for everything but Compat::MilkDrop3 presets that carry a sprite.

Trait Implementations§

Source§

impl Clone for FrameInput

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for FrameInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for FrameInput

Source§

fn default() -> Self

A default MilkDrop state at frame 0 with silent audio (decay .98, gamma 2, white wave 0).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more
Source§

impl<T> WasmNotSend for T

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T