pub enum Compat {
ProjectM,
MilkDrop2,
MilkDrop3,
}Expand description
Which reference behaviour the renderer follows where MilkDrop 2 (third_party/md2) and
projectM differ. Default: projectM.
Every divergence handled by this switch (see Compat::rules):
| item | ProjectM | MilkDrop2 |
|---|---|---|
_c3.w/_c4.w (vol, vol_att) | (bass+mid+treb)*0.333 | 0.3333*treb (C comma-operator bug) |
_c12.y (mip_y) | from height | from width (typo) |
_c1 (aspect “sd”) | zeros | aspect for the sd variant |
| no-shader warp decay | min(decay,1) as float, no 8-bit rounding | (int)(decay*255)&0xFF (truncated, wraps) |
| vertex colours (waves, shapes, borders, mv, echo) | float, modulo-wrapped like & 0xFF when out of 0..1 | 8-bit truncated |
| no-shader comp hue tint | always applied | only if fShader > 0.001, blended by fShader |
| thick / dots main-wave passes | whenever thick || dots | additionally needs texsize >= 512 |
| custom-shape thick outline offset | 1/W (half a pixel) | 2/W (one pixel) |
| motion vectors: first frame | skipped | drawn |
| motion vectors: min length / lookup | 1.25 px, geometrically correct row | 1 px, mirrored-row lookup (ReversePropagatePoint) |
comp-shader sampler_main | current frame (after waves/borders) | previous frame (m_lpVS[0] in ApplyShaderParams) |
warp mesh ang seam | no fix (interpolates across the +-pi seam row) | ang patched to -pi / +pi per half |
| comp mesh UV | uv + 0.5/size (half-texel) | exact (the D3D9 half-pixel compensation nets to 0) |
warp-shader VsOut.diffuse | (decay, decay, decay, 1) | (1, 1, 1, 1) |
| no-shader composite hue-tint corners | shade[0..1] at the top corners (projectM draws the quad in its flipped frame) | shade[0..1] at the bottom corners |
blur pass 0 vertical +1 texel bias | -1 (projectM samples the upside-down stored source with uv.y flipped, so the bias goes up) | +1 (down) |
| warp mesh cell diagonal | bottom-left to top-right in image space (projectM’s mesh row 0 is the top) | top-left to bottom-right |
| no-shader composite / filter quad diagonal | TL,TR,BL,BR strip: split along top-right to bottom-left (hue-tint colours interpolate differently) | triangles (0,1,2),(2,1,3) of geom::echo_quad (bottom-right to top-left) |
| no-shader echo / gamma quad size | scaled by VideoEcho’s aspectMultX/Y (x stretched by H/W on portrait targets, UVs unchanged) | 1 + 1/size |
| no-shader gamma pass count | (int)(gamma - 0.0001) + 1 | (int)(gamma - 0.001) + 1 |
| lines / points | GL rasterisation rules emulated exactly (StrokeRaster) | D3D9 thin quads |
| custom-wave dots | the 2n-1 vertices of SmoothWave, always 1 px (gl_PointSize ignored) | the n source points, 1 + thick px |
| custom-wave thick offset | 1/W ndc in x and y (half a pixel in x, H/2W px in y) | 2/W, 2/H (one pixel) |
rot_* uniforms | translation row dropped (glm::mat3x4 of a mat4: only the 3 rotation columns are uploaded) | float4x3 incl. the translation row |
| first frame of a preset whose shaders sample blur (the frame that allocates the blur textures) | shapes, waves, main wave, darken centre, borders lost (BlurTexture::Update restores FBO 0) | drawn |
| custom wave / shape slots that run | 4 each (CustomWaveformCount, CustomShapeCount; slots 4..15 are ignored) | 16 each |
warp shader sampler_main (first main sampler in name order) | filter linear, address from bTexWrap (WarpedBlit rebinds unit 0) | whatever the shader’s sampler prefix says |
preset change (Transition::Soft) | image-space cross-fade of two independently rendered presets by one of six built-in transition shaders (md2_preset_blend = false) | MD2’s own blend inside one frame pipeline: both states’ equations run, per-vertex UVs blended by a random pattern, old/new shaders drawn as alpha-tiled passes (md2_preset_blend = true) |
preset code lines (md2_code_join) | joined with \n | joined with nothing and // / \\ comments stripped (CState::StripLinefeedCharsAndComments) |
gamma / echo / filter flags / main-wave mode and flags (frame_vars_drive_post) | the preset’s initial values | the per-frame variable values |
shader random streams (shared_shader_rand) | separate warp / comp streams, constructor draws after rand_preset | one shared stream per preset |
warp animation terms (warp_anim_projectm) | projectM’s y sign and GPU pow | MD2’s |
shapecode_N_image key (custom_shape_image) | read | not a key (stays in extra) |
no-shader composite sampler address (noshader_comp_wrap) | clamp | wrap |
expression language (md3_ns_eel2) | projectm-eval | projectm-eval / projectm-eval / ns-eel2 (MilkDrop 3 only) |
preset code that fails to compile (md3_drop_failed_code) | the preset is rejected | the preset is rejected (MilkDrop 2 itself drops the part; not ported) / MilkDrop 3 drops the part and loads |
.milk2 double presets (md3_double_preset) | not loaded (error) | not loaded (error) |
soft-cut blend patterns (md3_blend_patterns) | (projectM transition shaders) | BeatDrop’s 19 (MD3: its 30) |
MilkDrop3 is MilkDrop2 plus the MilkDrop 3 deltas (see docs/md3.md); every MD3 delta is a field of
CompatRules, and Compat::md2_family is true for both variants.
Not switchable (identical in both): blur chain, blur source (previous frame image), blur min/max “push apart” typo.
Variants§
ProjectM
projectM’s behaviour (the default).
MilkDrop2
MilkDrop 2’s behaviour (Direct3D 9 semantics).
MilkDrop3
MilkDrop 3 (3.37) behaviour: MilkDrop 2 / BeatDrop rules plus the MilkDrop 3 deltas. MD3’s source is unpublished;
its behaviour is implemented from clean-room specs, see docs/md3.md.
Implementations§
Source§impl Compat
impl Compat
Sourcepub fn rules(self) -> CompatRules
pub fn rules(self) -> CompatRules
The behaviours of this compatibility mode.
Sourcepub fn md2_family(self) -> bool
pub fn md2_family(self) -> bool
MilkDrop 2 or MilkDrop 3: the modes that run the whole MilkDrop 2 code path (preset importer, shader
translation, soft-cut machinery). Individual behaviours are CompatRules fields, not this.
Trait Implementations§
impl Copy for Compat
impl Eq for Compat
impl StructuralPartialEq for Compat
Auto Trait Implementations§
impl Freeze for Compat
impl RefUnwindSafe for Compat
impl Send for Compat
impl Sync for Compat
impl Unpin for Compat
impl UnsafeUnpin for Compat
impl UnwindSafe for Compat
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.