pub struct MilkBundle {
pub per_frame_init: EelProgram,
pub per_frame: EelProgram,
pub per_vertex: EelProgram,
pub waves: Vec<MilkElement>,
pub shapes: Vec<MilkElement>,
pub warp_wgsl: Option<String>,
pub comp_wgsl: Option<String>,
pub blur_level: u8,
pub quantize_steps: f32,
}Expand description
A converted preset’s compiled programs: what a bundle carries beyond an ordinary Ritmolux preset.
Cloned into the warp mesh’s structural config at load and never touched again
— the runtime state lives in MilkRuntime, not here, so the same bundle can
drive two scenes (the roster’s and a [layer]’s) without them sharing a
register file.
Fields§
§per_frame_init: EelProgramRun once at preset load.
per_frame: EelProgramRun once per frame.
per_vertex: EelProgramRun once per mesh vertex.
waves: Vec<MilkElement>Up to four custom waves — extra traces the preset draws with their own per-point programs (Plan 0100 Phase 4). 47 % of the corpus enables at least one, which is why they are here rather than warned about.
shapes: Vec<MilkElement>Up to four custom shapes — filled polygons with their own per-instance programs. 63 % of the corpus enables at least one.
warp_wgsl: Option<String>The translated MilkDrop 2 warp shader, as a complete WGSL fragment
module (Plan 0100 Phase 6). None — most of MilkDrop 1.x, and any
MilkDrop 2 preset that never wrote one — takes the engine’s built-in
decay path. Validated through naga at load (shader::validate_wgsl).
comp_wgsl: Option<String>The translated comp shader — replaces the built-in present remaps when
present. See warp_wgsl.
blur_level: u8The deepest GetBlur/sampler_blur level either shader reaches,
0..=3. Zero means the blur chain never runs for this preset.
quantize_steps: f32How many levels this bundle’s feedback field quantizes to at the end
of the warp pass (ADR-0118), defaulting to DEFAULT_QUANTIZE_STEPS.
The presence of a bundle is what turns this on, which is the whole
per-bundle shape: the reference’s 8-bit target truncates a decay-scaled
dim pixel to zero and this engine’s Rgba16Float field does not, so an
imported preset wants the emulation and a native warp_mesh world — which
carries no bundle and so never reaches this field — does not.
0.0 is off. Negative selects ADR-0118’s Alternative D (floor to zero at
one step, no ladder between). Both are reachable from [milk] quantize_steps, so the look gate’s A/B is a preset edit rather than a
re-convert.
Implementations§
Source§impl MilkBundle
impl MilkBundle
Sourcepub fn from_assembly(
per_frame_init: Option<&str>,
per_frame: Option<&str>,
per_vertex: Option<&str>,
) -> Result<Self, BundleError>
pub fn from_assembly( per_frame_init: Option<&str>, per_frame: Option<&str>, per_vertex: Option<&str>, ) -> Result<Self, BundleError>
Decode a bundle from the three assembly sections. An absent section is the empty program, which runs nothing.
Sourcepub fn push_element(
&mut self,
kind: ElementKind,
init: Option<&str>,
per_frame: Option<&str>,
per_point: Option<&str>,
count: u32,
instances: u32,
use_dots: bool,
thick: bool,
additive: bool,
) -> Result<(), BundleError>
pub fn push_element( &mut self, kind: ElementKind, init: Option<&str>, per_frame: Option<&str>, per_point: Option<&str>, count: u32, instances: u32, use_dots: bool, thick: bool, additive: bool, ) -> Result<(), BundleError>
Attach one custom wave or shape, decoded from its own three assembly sections.
Its own register file, not the bundle’s — an element’s programs share
a scope with each other and with nothing else (see ElementRuntime), so
the roster check here is within the element and there is deliberately no
comparison against per_frame’s. Only q1-q32 cross, by copy.
Silently over-count is not an option: count and instances are what the
draw layer’s buffers were sized from, so they are clamped to the format’s
own limits by ElementRuntime::spec on the way out rather than trusted.
Sourcepub fn uses_random(&self) -> bool
pub fn uses_random(&self) -> bool
Whether any program in the bundle draws from the RNG.
Trait Implementations§
Source§impl Clone for MilkBundle
impl Clone for MilkBundle
Source§fn clone(&self) -> MilkBundle
fn clone(&self) -> MilkBundle
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for MilkBundle
impl Debug for MilkBundle
Source§impl PartialEq for MilkBundle
impl PartialEq for MilkBundle
Source§fn eq(&self, other: &MilkBundle) -> bool
fn eq(&self, other: &MilkBundle) -> bool
self and other values to be equal, and is used by ==.