Skip to main content

CompatRules

Struct CompatRules 

Source
#[non_exhaustive]
pub struct CompatRules {
Show 38 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 pm_border_mesh: bool, pub custom_slots: usize, pub warp_main_sampler_from_wrap: bool, pub md2_preset_blend: 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.

§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 / filter quad is split top-right to bottom-left instead of bottom-right to top-left.

§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.

§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.

§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).

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> Downcast<T> for T

Source§

fn downcast(&self) -> &T

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> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

impl<T> WasmNotSend for T
where T: Send,

Source§

impl<T> WasmNotSendSync for T

Source§

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