Skip to content

MilkDrop Phase 2: visual rendering quality, user textures (img.ini), motion vectors, and smooth preset transitions #560

Description

@CaYatur

Follow-up to #559 and the core MilkDrop engine rewrite shipped in v3.1.2.

While v3.1.2 restored CSP-safe equation execution (via AST closure trees) and WebGL2 HLSL warp/composite pixel shader compilation for 91.7% of shader stages across 10,347 presets, several visual fidelity and engine features remain to be implemented in a dedicated quality pass:

1. Visual Rendering Quality & High-DPI Fidelity

  • Internal Supersampling & Resolution Scale: Allow rendering at 1x, 1.5x, or 2x internal resolution before downsampling to canvas, ensuring razor-sharp presets and shapes on 1440p and 4K displays.
  • Accurate Blur Texture Passes (sampler_blur1, sampler_blur2, sampler_blur3): Implement MilkDrop 2's progressive downscaled blur pyramid with authentic Gaussian kernels, giving presets their characteristic neon glow and bloom depth.
  • Texture Filtering & Precision: Configurable bilinear / anisotropic texture filtering on feedback buffers, plus precision controls to prevent color banding in dark scenes.

2. User / Sprite Textures (img.ini / sampler_main & sampler_noise_*)

  • Currently, user texture slots fall back to procedural Perlin / Simplex noise textures.
  • Implement loading and binding of preset-defined sprite sheets and image assets referenced in .milk / img.ini.

3. Motion Vectors (motion_vectors pass)

  • Implement grid-based motion vector mesh rendering (mv_x, mv_y, mv_dx, mv_dy, mv_l, mv_r, mv_g, mv_b, mv_a) before the composite shader pass.

4. Smooth Preset Transitions (Crossfade / Warp Dissolve)

  • Currently, preset changes switch immediately between active shader/state pipelines.
  • Implement MilkDrop's dual-buffer crossfade transition (fRating, variable transition duration from 1.0s to 5.0s with blend shader).

5. Interactive Mouse Input

  • Route mouse position and click state (mouse_x, mouse_y, mouse_down) into equation per-frame and per-vertex variables.

6. Remaining Shader Translations (8.3%)

  • Refine edge cases in HLSL intrinsic emulation (e.g. matrix multiplication semantics, complex swizzles in conditional branches) to push shader compilation beyond 95%.

7. Mesh Grid Density & Performance Settings

  • Expose configurable mesh grid resolution (e.g. 32x24, 48x36, 64x48, 96x72) in settings for balanced performance vs visual geometric smoothness.

8. Standalone Mode vs Layer Stack Pipeline Discrepancy & Stability

  • Layer Stack Isolation Advantage: MilkDrop currently runs with highest stability when instantiated as a layer within LayerStack (kind: 'visualizer', type: 'milkdrop') because it receives an isolated <canvas> and independent WebGL2 rendering surface.
  • Standalone Mode Bug: When users attempt to run MilkDrop from the standalone "MilkDrop Presetleri" category with cfg.layerStack.enabled: true, resolve(cfg) ignores cfg.visualizer.type = 'milkdrop', causing user preset selection to have no visible effect.
  • Background Composite Conflict: In standalone mode (cfg.layerStack.enabled: false), synthesize(cfg) instantiates ly_bg beneath ly_vis, causing visual clipping or alpha/context collisions with MilkDrop's internal ping-pong FBOs.
  • Sidebar Lifecycle Lock: The standalone panel is conditionally hidden when cfg.visualizer.type !== 'milkdrop', which desynchronizes navigation when switching presets.
  • Goal: Unify standalone MilkDrop mode with the layer pipeline so switching into MilkDrop from the dedicated panel behaves seamlessly whether Layer Stack is enabled or disabled.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions