Skip to main content

CompatRules

Struct CompatRules 

Source
#[non_exhaustive]
pub struct CompatRules {
Show 70 fields pub vol_is_comma_bug: bool, pub mip_y_from_width: bool, pub c1_is_zero: bool, pub decay_8bit: bool, pub quantize_vertex_colors: bool, pub hue_tint_always: bool, pub thick_needs_512: bool, pub pm_waveforms: bool, pub shape_thick_full_pixel: bool, pub mv_skip_first_frame: bool, pub mv_min_len_px: f32, pub mv_mirrored_lookup: bool, pub comp_reads_previous: bool, pub ang_seam_fix: bool, pub comp_uv_half_texel: bool, pub shader_warp_diffuse_is_decay: bool, pub rot_translation_dropped: bool, pub shade_top_first: bool, pub blur_src_flipped: bool, pub warp_diag_flipped: bool, pub echo_diag_flipped: bool, pub echo_quad_aspect: bool, pub gamma_pass_eps: f32, pub gl_strokes: bool, pub wave_dots_smoothed: bool, pub point_size_honored: bool, pub wave_thick_ndc_inc: bool, pub wave_point_f64_aspect: bool, pub no_mipmaps: bool, pub warp_uv_on_gpu: bool, pub main_alpha: bool, pub shape_main_nearest: bool, pub blur_alloc_drops_overlays: bool, pub gl_fill_ties: bool, pub gl_varying_fold: bool, pub pm_border_mesh: bool, pub custom_slots: usize, pub max_rand_slot: u8, pub rand_filter_raw_name: bool, pub noisevol_row_stride: bool, pub warp_main_sampler_from_wrap: bool, pub md2_preset_blend: bool, pub md2_code_join: bool, pub frame_vars_drive_post: bool, pub shared_shader_rand: bool, pub warp_anim_projectm: bool, pub custom_shape_image: bool, pub noshader_comp_wrap: bool, pub md3_wave_modes: bool, pub max_shape_sides: i32, pub md3_warp_skip_tiny: bool, pub md3_border_gate: bool, pub md3_auto_hard_cut: bool, pub md3_preset_time_rand: bool, pub md3_audio_analysis: bool, pub md3_shader_fft: bool, pub md3_extended_vars: bool, pub md3_shader_prelude: bool, pub md3_shader_time: bool, pub shader_time_wrap: bool, pub md3_md2_comp_effects: bool, pub md3_ns_eel2: bool, pub md3_drop_failed_code: bool, pub md3_double_preset: bool, pub md3_blend_patterns: bool, pub md3_preset_sprites: bool, pub md3_gif_textures: bool, pub md3_sprite_burn_twice: bool, pub md2_shader_inputs: bool, pub md2_input_vars: bool,
}
Expand description

The individual behaviours selected by a Compat value (see the table there for the projectM / MilkDrop 2 values of each).

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§vol_is_comma_bug: bool

vol / vol_att follow MD2’s comma-operator bug (0.3333*treb).

§mip_y_from_width: bool

_c12.y (mip_y) is derived from the width instead of the height (MD2 typo).

§c1_is_zero: bool

_c1 (aspect “sd”) is all zeros.

§decay_8bit: bool

The no-shader warp decay is truncated to 8 bits and wraps, (int)(decay*255)&0xFF.

§quantize_vertex_colors: bool

Vertex colours are 8-bit truncated; otherwise float, modulo-wrapped like & 0xFF when outside 0..1.

§hue_tint_always: bool

The no-shader composite hue tint is always applied; otherwise only if fShader > 0.001, blended by fShader.

§thick_needs_512: bool

Thick / dots main-wave passes additionally need a texture size of at least 512.

§pm_waveforms: bool

Main waveform geometry/alpha follow projectM Waveforms/*.cpp (wavegen::main_wave_geometry_projectm) instead of the MD2 DrawWave port (wavegen::main_wave_geometry).

§shape_thick_full_pixel: bool

The custom-shape thick outline offset is one pixel (2/W) instead of half a pixel (1/W).

§mv_skip_first_frame: bool

Motion vectors are skipped on the first frame.

§mv_min_len_px: f32

Minimum motion-vector length in pixels.

§mv_mirrored_lookup: bool

Motion-vector lookup uses MD2’s mirrored row (ReversePropagatePoint).

§comp_reads_previous: bool

The composite shader’s sampler_main reads the previous frame instead of the current one.

§ang_seam_fix: bool

The warp mesh ang seam is patched to -pi / +pi per half instead of interpolating across the seam row.

§comp_uv_half_texel: bool

The composite mesh UV gets a half-texel offset (uv + 0.5/size).

§shader_warp_diffuse_is_decay: bool

A warp shader’s VsOut.diffuse is (decay, decay, decay, 1) instead of (1, 1, 1, 1).

§rot_translation_dropped: bool

The translation row of the rot_* uniforms is dropped (glm::mat3x4 of a mat4).

§shade_top_first: bool

The no-shader composite hue-tint colours shade[0..1] sit at the top corners instead of the bottom ones. MD2’s v3[0..1] have y = +1 + 1/H, which support.cpp’s flipped ortho projection puts at the bottom of the image.

§blur_src_flipped: bool

Blur pass 0 samples an upside-down source, so its vertical +1 texel bias is -1.

§warp_diag_flipped: bool

Warp mesh cells are split bottom-left to top-right in image space instead of top-left to bottom-right.

§echo_diag_flipped: bool

The no-shader composite echo / gamma quad is split top-right to bottom-left instead of bottom-right to top-left. The flat white filter quads (brighten ..) have the same split in projectM but no colour gradient, so it is not observable there.

§echo_quad_aspect: bool

projectM stretches the echo / gamma quad by aspectMultX/Y of VideoEcho::Draw (geom::echo_aspect_mult): identity for landscape targets, a horizontal H/W magnification of the centre for portrait ones. MD2 draws the plain 1 + 1/size quad.

§gamma_pass_eps: f32

Epsilon of the gamma pass count of the no-echo composite, (int)(gamma - eps) + 1 passes: projectM (VideoEcho::DrawGammaAdjustment) 0.0001, MD2 (ShowToUser_NoShaders) 0.001.

§gl_strokes: bool

Lines and points follow OpenGL rasterisation rules (see StrokeRaster) instead of D3D9 thin quads.

§wave_dots_smoothed: bool

Custom-wave dots use the 2n-1 vertices of SmoothWave; otherwise the n source points.

§point_size_honored: bool

Point sizes (1 + thick px) are honoured; otherwise points are always 1 px (gl_PointSize ignored).

§wave_thick_ndc_inc: bool

The custom-wave thick offset is 1/W ndc in x and y; otherwise 2/W, 2/H (one pixel).

§wave_point_f64_aspect: bool

Custom-wave point positions: projectM static_cast<float>((x * 2.0 - 1.0) * invAspectX) (the product is taken in double, one rounding to f32); MD2 (float)(x * 2 - 1) * m_fInvAspectX (rounded to f32 before the product).

§no_mipmaps: bool

projectM textures have a single level (no glGenerateMipmap, samplers use the plain GL_LINEAR / GL_NEAREST min filter), so tex2D never blends mip levels and tex2Dlod / tex2Dbias read level 0. MD2 uses D3D9 textures with a mip chain (trilinear).

§warp_uv_on_gpu: bool

projectM evaluates the warp UV formula (pow, sin, cos, multiply-adds) in its vertex shader, so the result carries the GPU’s approximations and fusion; MD2 does it on the CPU (D3DX/libm floats). With this rule the renderer runs the warp vertex shader on the per-vertex inputs of FrameInput::warp_gpu.

§main_alpha: bool

projectM: the internal images are RGBA; main starts at alpha 0, the no-shader warp keeps tex.a, shaders write 1, overlays blend alpha with the colour factors and textured fills multiply by tex.a. MD2 (X8R8G8B8) has no alpha: sampled alpha is 1 and nothing is written.

§shape_main_nearest: bool

projectM binds the GL_NEAREST flip texture (set by TextureAttachment) for textured shapes that sample the main image; MD2 samples it bilinearly.

§blur_alloc_drops_overlays: bool

projectM: on the frame that (re)allocates the blur textures (first frame after preset load / resize) of a preset whose shaders sample blur, BlurTexture::Update restores the wrong framebuffer, so shapes, waves, main wave, darken-centre and borders of that frame are drawn to the default framebuffer and lost. MD2 draws them.

§gl_fill_ties: bool

projectM draws in GL window space (y up), lactea’s targets are y down (wgpu / D3D9): both use the top-left rule, so a pixel centre lying exactly on a horizontal triangle edge goes to the polygon below the edge in wgpu and to the polygon above it in projectM. With this rule such triangle fills (borders whose size * H / 2 is a half integer) are nudged by one sub-pixel step (geom::gl_fill_ties). MD2 (D3D9) has the wgpu rule.

§gl_varying_fold: bool

projectM’s GL driver (Mesa) moves interpolated input ± uniform/constant (and a few other linear operations) of the user warp / composite fragment shader into the vertex stage and interpolates the result, which differs from interpolating the input and adding in the fragment stage by about 1 ulp. With this rule the HLSL translator emits those per-vertex values (CompiledShader::folds) and the renderer delivers them as extra varyings. MD2 (D3D9) and wgpu keep the fragment-stage arithmetic.

§pm_border_mesh: bool

Borders are one 8-vertex / 8-triangle mesh in projectM (Border.cpp, mirrored vertically by its y-flipping projection), four rotated quads in MD2. Identical for sane sizes, different when ob + ib > 1 or a size is negative (self-overlapping triangles).

§custom_slots: usize

Number of custom wave / custom shape slots that run: projectM CustomWaveformCount / CustomShapeCount = 4 (the keys wavecode_4..15 / shapecode_4..15 are never read), MD2 / MAX_CUSTOM_* = 16.

§max_rand_slot: u8

Highest randNN sampler slot that picks a random texture: projectM MilkdropShader.cpp:130 (15), MD2 MAX_RAND_TEX - 1 (plugin.cpp:3420, 99). Higher slots are ordinary texture names.

§rand_filter_raw_name: bool

The randNN_prefix pool filter reads the raw sampler name (projectM TextureManager::GetRandomTexture tests byte 6 of the name with its fw_-style quality prefix, so a quality prefix disables the filter) and any randNN… spelling counts; MD2 filters on the prefix-stripped name and needs exactly randNN or randNN_… (plugin.cpp:3578). Both peel the quality prefix before detecting randNN (MilkdropShader.cpp:80-86).

§noisevol_row_stride: bool

The noisevol_* cubic smoothing addresses slice z with z * size (projectM MilkdropNoise.cpp:199,225, 252-261), not MD2’s z * size * size (plugin.cpp:3031-3072).

§warp_main_sampler_from_wrap: bool

projectM’s PerPixelMesh::WarpedBlit binds its own sampler (GL_LINEAR, GL_REPEAT / GL_CLAMP_TO_EDGE from the per-frame wrap variable, i.e. bTexWrap) on texture unit 0 after the warp shader loaded its samplers, which replaces the sampler of the first main descriptor (std::set order of the sampler names, main always present): a warp shader’s sampler_main follows wrap, not the fw_/fc_/pw_/pc_ prefix. MD2 uses the sampler declared in the shader.

§md2_preset_blend: bool

Soft cuts follow MilkDrop 2’s m_bBlending (state.cpp StartBlendFrom, milkdropfs.cpp RenderFrame): the old preset’s state stays alive next to the new one inside a single frame pipeline (one renderer, old shaders in m_OldShaders). projectM instead renders both presets to their own images and blends the finished images with one of six transition shaders (TransitionKind).

§md2_code_join: bool

Preset code lines are joined like CState::StripLinefeedCharsAndComments: the \x01 line separators are deleted without a replacement and // / \\ comments are dropped up to the next separator, so a statement split across two lines glues its halves together (k1 = is_ + beat*... is k1 = is_beat*...). Otherwise the lines are joined with \n (projectM). Applies to every EEL code part, never to shader text.

§frame_vars_drive_post: bool

gamma, echo_*, brighten / darken / solarize / invert and the main wave’s wave_mode / wave_thick / wave_usedots / wave_additive take the per-frame variable values instead of the preset’s initial values (projectM reads the file values).

§shared_shader_rand: bool

The warp and composite shaders share one random stream per preset (drawn once per frame); projectM keeps one stream per pass and consumes the constructor draws after rand_preset.

§warp_anim_projectm: bool

The warp animation terms use projectM’s y sign and GPU-style pow (WarpAnim::projectm) instead of MD2’s.

§custom_shape_image: bool

shapecode_N_image (projectM addition) names a user texture a textured shape samples.

§noshader_comp_wrap: bool

The no-shader composite pass samples the feedback image with the Wrap address mode; otherwise Clamp.

§md3_wave_modes: bool

The main waveform follows MilkDrop 3 (wavegen_md3::main_wave_geometry_md3_raw): 17 modes 0..=16 selected by the C remainder (int)wave_mode % 17 (a negative result draws 480 zero vertices), one channel per formula.

§max_shape_sides: i32

Largest sides a custom shape is drawn with (smallest is 3): projectM and MilkDrop 2 100, MilkDrop 3 500.

§md3_warp_skip_tiny: bool

MilkDrop 3 adds the four warp sin / cos terms to the warp UV only when |warp| > 0.0001.

§md3_border_gate: bool

MilkDrop 3 hides the outer / inner borders while a preset blend is running if the host’s DisableBox setting is on (EngineConfig::md3_disable_box).

§md3_auto_hard_cut: bool

MD3 AutoHardCutMode 1..7 (lactea::auto_cut) is active: the engine watches the previous frame’s bass / treb and asks for instant preset changes or injects composite-shader effects. Off under projectM and MD2.

§md3_preset_time_rand: bool

MD3 display time of a preset: BlendTimeAuto + TimeBetweenPresets + (rand() % 1000) * TimeBetweenPresetsRand * 0.001 (hosts feed it to PresetControl::set_md3_time_rand) instead of projectM’s gaussian easter egg.

§md3_audio_analysis: bool

MilkDrop 3 audio analysis (AnalysisMode::Md3): left channel only, 576-sample Hann FFT, 8-bit quantised input scaled by VolumeSensitivity, silence -> 1.0 (docs/md3.md, shader inputs).

§md3_shader_fft: bool

The MilkDrop 3 shader FFT texture (sampler_fft): a max-normalised, gated, smeared attack / decay recursion of the left spectrum, run once per rendered frame and kept across presets; FFTAttack / FFTDecay are sticky globals set by every preset load.

§md3_extended_vars: bool

MilkDrop 3’s extended expression and shader variables: q1..q64, t1..t16, monitor2 / monitor3 and the _c14 / _qi.._qp shader constants (the mouse is a shader input only: mouse.x does not compile in preset code).

§md3_shader_prelude: bool

The MilkDrop 3 shader prelude is part of every translated shader (get_fft, get_fft_hz, mouse*, q33..q64, sampler_fft).

§md3_shader_time: bool

The shader constant time (_c2.x) is the time since this state’s preset started; otherwise the absolute frame time (see also shader_time_wrap).

§shader_time_wrap: bool

_c2.x is wrapped modulo 10000 (t - (int)(t / 10000) * 10000): projectM (MilkdropShader.cpp:168) and MilkDrop 3. MilkDrop 2 passes the raw time (milkdropfs.cpp:5289).

§md3_md2_comp_effects: bool

The generated composite shader of presets without comp_N text uses the original MilkDrop 2 formulas: brighten sqrt(ret), solarize ret * (1 - ret) * 4 (BeatDrop: 1 - (1 - ret)^2, * 2).

§md3_ns_eel2: bool

Preset expressions run on ns-eel2 (lactea_eel::Dialect::NsEel2, MilkDrop 3’s engine: unguarded /, assignment filtering, integer %, $PI constants, 8M-entry megabuf, wrapping gmegabuf and registers that outlive presets, …) instead of projectm-eval. docs/md3.md, “Expression engine”.

§md3_drop_failed_code: bool

A code part that fails to compile is dropped (with a warning) and the preset still loads: a failed init part zeroes the post-init q values, a failed per-frame / per-vertex / wave / shape part simply does not run. Otherwise the first failing part rejects the preset (EngineError::Compile).

§md3_double_preset: bool

MilkDrop 3 .milk2 double presets: two presets in one file, played as a frozen MD2 soft cut with its own progress modes (docs/md3.md). Loading a .milk2 without this rule is an error.

§md3_blend_patterns: bool

Ordinary soft cuts draw their blend pattern from MilkDrop 3’s 30 patterns (the enabled list) instead of BeatDrop’s 19. Needs md2_preset_blend.

§md3_preset_sprites: bool

MilkDrop 3: a preset’s sprite block (SpriteName .. SpriteRepeatY, docs/md3.md) loads an image and draws it every frame at the layer the preset names, with the 11 sprite blend modes. projectM and MilkDrop 2 never draw preset sprites.

§md3_gif_textures: bool

MilkDrop 3: shader textures (sampler_<name>) are also searched in the sprites and gifs folders, accept .gif / .jfif files, and an animated GIF shows the frame picked by fmod(time, total) of its delays.

§md3_sprite_burn_twice: bool

MilkDrop 3: a burning sprite in layers 1..4 is drawn twice into the feedback image (it burns into the image it is already drawn on), so additive and alpha modes are twice as strong with SpriteBurn=1 as with 0. Measured against MD3 under Wine (docs/md3.md, sprites).

§md2_shader_inputs: bool

BeatDrop’s shader inputs under MilkDrop 2: the shader prelude (_c14 mouse, _c15 / _c16 time and date, sampler_fft / sampler_wave, get_fft*, get_wave), the engine-fed spectrum / waveform texture and the BeatDrop shader-FFT analyser (RMS-normalised 2048-window FFT with FPS-independent attack / decay and a peak hold). Off under projectM (sampler_fft stays an unresolved user texture, so projectM-compat output is untouched) and MilkDrop 3 (its own prelude, md3_shader_prelude).

§md2_input_vars: bool

BeatDrop’s expression variables for host input and the clock: mousex mousey mousedown mouseclick, ctrllt ctrlrt ctrldn ctrlup and year month day weekday hour minute second milliseconds totalseconds, set by the engine every frame in the per-frame and per-vertex contexts. MilkDrop 3 has none of them (its mouse is shader-only and mouse.x does not compile), so it turns this off.

Trait Implementations§

Source§

impl Clone for CompatRules

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 CompatRules

Source§

impl Debug for CompatRules

Source§

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

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

impl PartialEq for CompatRules

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 CompatRules

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<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<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,