AuburnSounds / Dplug

Audio plugin framework. VST2/VST3/AU/AAX/LV2 for Linux/macOS/Windows.
https://dplug.org/
Other
485 stars 32 forks source link

Better mipmap halfband filter #827

Closed p0nce closed 10 months ago

p0nce commented 10 months ago

https://bartwronski.com/2022/03/07/fast-gpu-friendly-antialiasing-downsampling-filter/

p0nce commented 10 months ago

https://observablehq.com/@jobleonard/gaussian-kernel-calculater

p0nce commented 10 months ago

it makes little difference it seems. image ^highlights exagerated 8x.

Left: baseline 1331 4 taps Right: handmade Magic Kernel 4 taps. Still not anisotropic.

It seems the biggest visual issue is the bilinear sampling itself.

p0nce commented 10 months ago

image All cubic sampling (right) vs all linear sampling (left) on the 5 mipmap levels. Doing it on later levels would be a bit more expensive but also solves part of the issue. Agair both our mipmapping filter don't make a difference, I think those filters are wrong.

p0nce commented 10 months ago
p0nce commented 10 months ago
p0nce commented 10 months ago

Basically making the mipmap blurrier works to mask anisotropy. That would be just for diffuse (emisive effect) since depth would probably suffer from changes like this.

p0nce commented 10 months ago

Baseline | New mipmap kernel for diffuse + one cubic sample at highest level | New mipmap kernel for diffuse + two cubic samples at highest level

image

aaaaand the new kernel isn't especially nicer on Graillon. It's mostly just a bit blurrier. Let's see how much cubicSample we need first.

p0nce commented 10 months ago

2 samples of cubic > all samples of cubic (!!!) >> 1 samples of cubic >> all linear samples >> no futurePBREmissive futurePBREmissive gets 2 samples of cubic for the higher mipmaps then.

p0nce commented 10 months ago

mmmm, perhaps 0.5493 * 0.35 as variance was too small, try higher. =>no, not worth it

p0nce commented 10 months ago

futurePBREmissive has changed in a small way