Skip to main content

Compat

Enum Compat 

Source
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):

itemProjectMMilkDrop2
_c3.w/_c4.w (vol, vol_att)(bass+mid+treb)*0.3330.3333*treb (C comma-operator bug)
_c12.y (mip_y)from heightfrom width (typo)
_c1 (aspect “sd”)zerosaspect for the sd variant
no-shader warp decaymin(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..18-bit truncated
no-shader comp hue tintalways appliedonly if fShader > 0.001, blended by fShader
thick / dots main-wave passeswhenever thick || dotsadditionally needs texsize >= 512
custom-shape thick outline offset1/W (half a pixel)2/W (one pixel)
motion vectors: first frameskippeddrawn
motion vectors: min length / lookup1.25 px, geometrically correct row1 px, mirrored-row lookup (ReversePropagatePoint)
comp-shader sampler_maincurrent frame (after waves/borders)previous frame (m_lpVS[0] in ApplyShaderParams)
warp mesh ang seamno fix (interpolates across the +-pi seam row)ang patched to -pi / +pi per half
comp mesh UVuv + 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 cornersshade[0..1] at the top corners (projectM draws the quad in its flipped frame)shade[0..1] at the bottom corners
blur horizontal passes source offset (blur_halfpixel_bias)none (pixel centre; projectM a2c56d2)+1 texel right and below (MD2 blur1_ps, source arithmetic kept; see docs/divergences.md)
blur pass 0 vertical +1 texel bias (only with the offset)-1 (projectM samples the upside-down stored source with uv.y flipped, so the bias goes up)+1 (down)
warp mesh cell diagonalbottom-left to top-right in image space (projectM’s mesh row 0 is the top)top-left to bottom-right
no-shader composite echo / gamma quad diagonalTL,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; MD2’s strip (0,1,2),(1,2,3) over v3[0..4] = (-W,+H),(+W,+H),(-W,-H),(+W,-H), whose +y is the bottom of the screen under D3DXMatrixOrthoLH(2, -2) in support.cpp)
no-shader echo / gamma quad sizescaled 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
user shader redeclares an include.fx sampler (reject_include_sampler_redeclaration)accepted, declaration ignoredcompile error, the pass falls back to the default shader
lines / pointsGL rasterisation rules emulated exactly (StrokeRaster)D3D9 thin quads
custom-wave dotsthe 2n-1 vertices of SmoothWave, always 1 px (gl_PointSize ignored)the n source points, 1 + thick px
custom-wave thick offset1/W ndc in x and y (half a pixel in x, H/2W px in y)2/W, 2/H (one pixel)
rot_* uniformstranslation 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 run4 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 \njoined with nothing and // / \\ comments stripped (CState::StripLinefeedCharsAndComments)
gamma / echo / filter flags / main-wave mode and flags (frame_vars_drive_post)the preset’s initial valuesthe per-frame variable values
shader random streams (shared_shader_rand)separate warp / comp streams, constructor draws after rand_presetone shared stream per preset
warp animation terms (warp_anim_projectm)projectM’s y sign and GPU powMD2’s
shapecode_N_image key (custom_shape_image)readnot a key (stays in extra)
no-shader composite sampler address (noshader_comp_wrap)clampwrap
expression language (md3_ns_eel2)projectm-evalprojectm-eval / projectm-eval / ns-eel2 (MilkDrop 3 only)
preset code that fails to compile (drop_failed_code)the part is dropped and the preset loadsthe part is dropped and the preset 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)
main waveform modes 9..17 (md2_wave_modes_9_17)projectM’s own 16-mode list (pm_waveforms)BeatDrop / MilkDrop2077 modes (MD3: its own 17)

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 taps and weights, 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

Source

pub fn rules(self) -> CompatRules

The behaviours of this compatibility mode.

Source

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§

Source§

impl Clone for Compat

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 Copy for Compat

Source§

impl Debug for Compat

Source§

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

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

impl Default for Compat

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for Compat

Source§

impl Hash for Compat

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Compat

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Compat

Auto Trait Implementations§

§

impl Forget for Compat

§

impl Freeze for Compat

§

impl Move 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> 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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,