Fast Blur with Animated Radius
9 hours ago
- The author developed 'Smol Gaussian', a blur algorithm designed for smoothly animated blur radii and independent X/Y blur amounts.
- Naive Gaussian blur cost grows as the square of radius; separable blur scales linearly, but large radii become slow.
- Smol Gaussian downsamples to a working resolution, applies a small separable Gaussian, then reconstructs, with careful variance accounting.
- It improves on Skia's Gaussian blur via better odd-size downsampling integration, variance subtraction, wider tapered kernels, and cubic B-spline reconstruction.
- A discarded approach, crossfading between working resolutions, added cost and complexity without visible benefit.
- Dual Kawase was extended for continuous radii and non-isotropic blur, but still feels non-smooth on HDR highlights.
- Skia's Gaussian behaves poorly on very bright HDR content, showing aliasing and wobbling.
- Blender's 'Fast Gaussian' uses recursive filtering, is constant-cost but not GPU-friendly and exhibits ringing artifacts.
- Ryg Blur (repeated box convolution) is simple and radius-independent but has limited parallelism and high memory traffic.
- Performance benchmarks show Smol Gaussian matches Skia's speed, while Dual Kawase is 2-3x slower in the tested implementation.
- The author provides an interactive WebGPU playground with six blur modes, image loading, animation, and benchmarking.
- A WIP Blender pull request (PR 164496) includes a CPU implementation that is faster than the existing Fast Gaussian with no ringing.