Skip to content

Conversation

almarklein
Copy link
Member

@almarklein almarklein commented Jun 13, 2025

Closes #75

  • Add FXAAPass and DDAAPass effects.
  • Add renderer.ppaa property that can be set to 'default', 'none', 'fxaa', or 'ddaa'.
  • This adds/removes the corresponding effect to the renderer.effect_passes.
  • Add PYGFX_PPAA to control what 'default' resolves to. The primary use-case is to turn it off for image tests.

Line without aa, on a regular (no-hidpi) screen, with pixel ratio 1:

afbeelding

With pixel ratio 2 (the trick we use by default):

afbeelding

With ddaa and pixel ratio 1:
afbeelding

More comparisons: https://almarklein.github.io/ppaa-experiments/viewer.html#image=lines.png&algs=ori,ssaax8,fxaa3,ddaa2


DDAA is bases on an idea I had in the early days of Visvis. I revived the idea and worked on it outside of "Pygfx hours". A small improvement in the perceived smoothness (without getting blurry) can be a big win, because it means we can turn the aa of objects off, which removes a whole range of artifacts, and maybe even reduce the ssaa (pixel_ratio).

Differences of DDAA w.r.t. FXAA:

  • Better smoothing for diagonal-ish edges.
  • Uses similar edge-search technique as FXAA, does not skip pixels, but (therefore) searches a bit less far with default settings.
  • Better preservation of small structures such as thin lines and parts of glyphs.
  • More performant than FXAA (with default settings).

For more info see https://github.com/almarklein/ppaa-experiments

@almarklein
Copy link
Member Author

I got stuck on #1118 when trying to create a validation example. Will proceed with this after #1121.

@almarklein almarklein changed the title Add support for FXAA Add support for FXAA and DDAA Jul 3, 2025
@almarklein almarklein marked this pull request as ready for review July 3, 2025 11:16
@almarklein
Copy link
Member Author

@Korijn this is also ready, btw

@Korijn Korijn enabled auto-merge (squash) July 11, 2025 13:55
@Korijn Korijn merged commit e5d918c into main Jul 11, 2025
13 checks passed
@Korijn Korijn deleted the fxaa branch July 11, 2025 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

FXAA
2 participants