Adaptive Smoothing (like RetroArch PSX Vulcan)

  • ZellSF
  • Topic Author
More
5 years 1 month ago - 5 years 1 month ago #1 by ZellSF Adaptive Smoothing (like RetroArch PSX Vulcan) was created by ZellSF
RetroArch implemented something called "Adaptive Smoothing" for their Vulcan render and PSX emulators that allows it to smooth 2D elements that are scaled while rendering 3D sharply at higher resolution:

The basic idea is to look at our 4x or 8x scaled image, we then mip-map that down to 1x with a box filter. While mip-mapping, we analyze the variance within the 4×4 or 8×8 block and stick that in alpha. The assumption here is that if we have nearest-neighbor scaled 2D elements, they typically have a 1:1 pixel correspondency in native resolution, and hence, the variance within the block will be 0. With 3D elements, there will be some kind of variance, either by values which were shaded slightly differently, or more dramatically, a geometry edge. We now compute an R8_UNORM “bias-mask” texture at 1x scale, which is 0.0 where we estimate we have 3D elements, and 1.0 where we estimate we have 2D. To avoid sharp transitions in LOD, the bias-mask is then blurred slightly with a 3×3 gaussian kernel (might be a better non-linear filter here for all I know).

On final scanout we simply sample the bias-mask, multiply that by log2(scale) and use that as an explicit lod in textureLod() with trilinear sampling, and magically 2D elements look smooth without compromising the 3D sharpness. Sure, it’s not perfect, but I’m quite happy with the result.

(from www.libretro.com/index.php/introducing-v...-beetlemednafen-psx/ )

Any chance anyone wants to implement that as a ReShade shader (is it even possible)? Not only are there lots of emulators that could benefit from this, but also a few ways of forcing PC game resolution (dgVoodoo, nGlide, maybe DxWnd) and some PC games that use nearest scaling.
Last edit: 5 years 1 month ago by ZellSF.

Please Log in or Create an account to join the conversation.

  • ZellSF
  • Topic Author
More
4 years 1 month ago #2 by ZellSF Replied by ZellSF on topic Adaptive Smoothing (like RetroArch PSX Vulcan)
Any chance for anything like this?

Please Log in or Create an account to join the conversation.

We use cookies
We use cookies on our website. Some of them are essential for the operation of the forum. You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.