Skip to content

Improved filtering and antialiasing#2661

Open
KojoZero wants to merge 20 commits into
melonDS-emu:masterfrom
KojoZero:improved-filtering-and-antialiasing
Open

Improved filtering and antialiasing#2661
KojoZero wants to merge 20 commits into
melonDS-emu:masterfrom
KojoZero:improved-filtering-and-antialiasing

Conversation

@KojoZero

Copy link
Copy Markdown

This PR adds more image filtering options and anti-aliasing settings such as FXAA and SMAA.

Changes

  • Added "Output Resampling" which has image filtering options such as: Nearest, Bilinear, Adaptive, Sharp Bilinear.
  • Adaptive uses bilinear filtering when the internal resolution is below the output resolution and area sampling when it is above. With this change, anytime the internal resolution is higher than the output resolution, the image gets properly downscaled without introducing aliasing (it essentially acts like SSAA).
  • Sharp Bilinear integer scales the image until it's greater than or equal to the output resolution using nearest neighbor filtering, and then downscales with bilinear filtering. The shader I use basically does this in a single pass.
  • All the filtering options have been gamma corrected
  • Added Anti-Aliasing options such as FXAA and SMAA

Note: Area sampling is paired with bilinear filtering because it's only meant for downscaling. I just used the name "Adaptive" because it uses different algorithms based on whether it's upscaling or downscaling, though I'm open to changing it to a better name or reworking it.

Screenshot 2026-05-15 182320 Screenshot 2026-05-15 182335

Closes #1100
Closes #848

@nadiaholmquist

Copy link
Copy Markdown
Collaborator

Generally looks good to me. It seems like (on Linux with an AMD GPU) there's a high chance of things breaking when changing the display options, swapping the 3D renderer between software/GL seems to fix it though, but that's not ideal.

Capitalization of the includes in Screen.cpp need to be changed as they won't work on case sensitive file systems, and a bit of the formatting needs to be made in line with the rest of the project.

@Felipefpl

Copy link
Copy Markdown

All those explanations of what the filters do will come as tooltips in the emulator? This must be done so the users will know what each of them will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants