Skip to content

almarklein/ppaa-experiments

Repository files navigation

ppaa-experiments

Compare post-processing aa methods (and ssaa)

A simple viewer is provided:

Goals

  • Compare existing techniques, focussing on pure-post-processing techniques (and only single-pass for now).
  • Compare on game-like as well as plot-like images.
  • Provide wgsl implemenentations for a few of these algorithms.
  • Experiment with the algorithms.

SSAA

I developed a flexible filter for image down and upsampling, which uses templating to select teh optimal filter kernel without sacrificying precision. Tests for this filter are added in Pygfx.

DDAA

I developed a new PPAA method called Directional Diffusion anti-aliasing (DDAA).

This project started in 2013, in the early days of the Vispy project (wiki post, code). I revived this in 2025, in search for a post-aa filter for Pygfx.

The main idea is that I found that many ppaa algorithms use a very simple way to estimate the orientation of the line, which makes no sense from a scale-space perspective; these algorithms are very much not rotationally invariant, which is probably why the early versions of FXAA still looked jaggy and were also too blurry. The idea: what if we use proper scale-space theory (i.e. Gaussian kernels)?

This turns out to work really well, especially for near-diagnoal lines. However, for near-horizontal and near-vertical lines, the algorithm must look further along the line to realize a smooth transition. For this, ddaa uses a similar algorithm as FXAA 3.11

Viewer

This repo contains an HTML file to compare different ppaa methods. You can see it online at https://almarklein.github.io/ppaa-experiments/viewer.html

When you've checked out the repo, you can simply open the local html-file in your browser. This is a great tool if you want to e.g. tweak existing methods, add another method, or develop your own method.

image

Experiments

This repo contains a script estimate_line_angles.py that shows that a Gaussian derivative kernel has an error in its angle estinate that is more than 2 times smaller than other kernels.

image

About

Compare post-processing aa methods (and ssaa)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published