Repository navigation
MilkDrop: fresh blur levels, MilkDrop's sampler wrap rules and 8-bit feedback rounding (#752) - #754
Merged
Merged
Conversation
) Blur levels 2 and 3 read the previous level through mipmaps that were only rebuilt after the whole chain, so they lagged one and two frames. Each level now reads its source's base level, as MilkDrop does. A plain sampler_main wraps in preset shaders: MilkDrop derives the wrap mode from the sampler name, and bTexWrap only applies to the shader-less warp. Blur passes read clamped, and textured shapes read clamped after a blur pass, both as in MilkDrop. 3,325 library presets have a shader and bTexWrap=0. Refs #752 Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
Refs #752 Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
|
CaYaDraft — pull request Summary Files
README.md (modified, +2/-2) README.tr.md (modified, +2/-2) ROADMAP.md (modified, +30/-2) |
MilkDrop's buffer is 8-bit and rounds every write to the nearest 1/255. Measured in patched MilkDrop: +0.0025 a frame climbs one level a frame, +0.0015 never moves, and a x0.9 decay stops at 4/255. The 10-bit buffer ran all three differently; "Dead CellWerx" flooded with red (frame 59: 20.0 -> 8.7). In accurate mode the warp's output, shader or shader-less, is rounded to 1/255. The buffer stays 10-bit, so what is drawn after the warp keeps its soft edges; a plain 8-bit buffer darkened line presets and was rejected. The comp pass is not fed back and is not rounded. Refs #752 Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
Refs #752 Co-authored-by: caganturgut <271973834+caganturgut@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Second quality round for #752. Three engine fixes, both checked against MilkDrop's source and measured against BeatDrop 53d83ee with the #750 patch.
Blur levels 2 and 3 were one and two frames behind
Each blur level's
outtexture is mipmapped, and the mipmaps were generated after the whole chain. The next level read it withtexture()at a smaller size, so it got last frame's mipmap. At a preset's start, blur2 was empty on its first frame and blur3 on its first two; MilkDrop fills both. MilkDrop's blur textures have a single level and are read bilinearly. Each level now reads its source withtextureLod(…, 0).sampler_mainwraps in preset shadersMilkDrop sets a sampler's wrap mode from its name:
sampler_mainis filtered and wraps (plugin.cpp:3445-3446);fc_andpc_clamp;bTexWrapis read only by the shader-less warp (milkdropfs.cpp:2217).The engine followed
bTexWrapin shaders too, so content leaving the screen stuck to the edge.bTexWrap = 0(a warp shader shiftinguv, a comp shader zooming out), MilkDrop wraps and matchessampler_fw_mainexactly. The engine's difference went 3.02 → 0.15.bTexWrap = 0.BlurPassessets CLAMP and never resets it. Blur now always reads clamped, through a sampler object.Measured
Main → branch. Mean difference on a 16-pixel grid, median over presets without user textures or randomness.
bTexWrap = 0(26 comparable)Looked at frame by frame:
Tried and dropped: full light for motion-vector segments. All 21 of #750's presets came out equal or worse.
The feedback rounds to 8 bits, as MilkDrop's does
With the blur fix alone, "Dead CellWerx" went 17.3 → 20.1 at f59, with a stepped ring and a red background. The root is buffer precision. MilkDrop's buffer is 8-bit and rounds every write to the nearest 1/255; butterchurn and projectM are 8-bit too. Our buffer is 10-bit (RGB10_A2).
Measured in patched MilkDrop with synthetic warps:
+0.0025/frame, f59+0.0015/frame, f59×0.9decay floor, warp shader×0.9decay floor, no warp shaderBefore → after the rounding, same MilkDrop frames:
bTexWrap = 0(26)Main → branch, all three fixes, noise-free comparable presets:
Nothing is worse by more than 1.03 except "fed - DSC-011", which went from black to MilkDrop's coloured fields.
Noise presets. BeatDrop seeds its noise textures from
std::random_deviceand the performance counter (plugin.cpp:645-646, 2863). Two MilkDrop runs of a noise preset differ by up to 17.6, while noise-free presets come out byte-identical. Every main → branch delta above uses one copy of MilkDrop's frames for both sides.Checks
npm testpasses 3020 of 3020, with 10 new tests.--user-data-dir): PASS. The real presets are unchanged; settings.json changed during the run because the installed app was open and writing it, while the smoke used its own profile.Refs #752, #560, #695