[SOLVED] linear filtering is blurry, point filtering is aliased

  • stealthptr
  • Topic Author
More
1 year 1 month ago - 1 year 1 month ago #1 by stealthptr linear filtering is blurry, point filtering is aliased was created by stealthptr
two screenshots from the game Control using the PerfectPerspective shader. one samples the framebuffer with linear filtering (blurry), the other with point filtering (aliased).
edit; please note, my settings for PerfectPerspective produce no magnification, ONLY minification
[img
[img

this screenshot of the map (point sampled) helps demonstrate what the shader is doing - if you look along the top of the map, you can see an increase in the frequency of the aliasing as more distortion is applied toward the edges of the field of view. what this means is that, for a very narrow slice of the FOV at the center of the screen, we are essentially doing nothing (no distortion is applied, and therefore no aliasing occurs) except blurring our 'fovea' with the linear filtering approach..
[img
[img
I am using Nvidia DLAA to produce a very crisp image at native resolution and I don't want to throw away all those perfectly clear pixels, just to correct the ridiculous distortion from rectilinear projection :(
I have already tried offsetting by fractions of a pixel in case it was sampling slightly off-centre, but no luck. I have thought about using a radial mask to point sample the original framebuffer toward the centre of the screen only, but that seems wasteful.. Any ideas? (I have never programmed shaders before)
Last edit: 1 year 1 month ago by stealthptr. Reason: additional context

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

  • stealthptr
  • Topic Author
More
1 year 1 month ago #2 by stealthptr Replied by stealthptr on topic linear filtering is blurry, point filtering is aliased
here is a function I made to check how close our float coordinate is to the corrosponding int coordinate - once it 'steps over' the int we get the aliasing effect, so we can apply linear filtering there selectively, as visualized in red
[img


here is PerfectPerspective.fx with just linear (default)
[img

here is PerfectPerspective.fx with the mixed point/linear approach - look at the monitor on the left hand side
[img
The following user(s) said Thank You: Fu-Bama

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

  • Fu-Bama
More
1 year 3 weeks ago - 1 year 3 weeks ago #3 by Fu-Bama Replied by Fu-Bama on topic linear filtering is blurry, point filtering is aliased
I have researched this issue and the root cause of the blurring is the sampling indeed. But the solution would be using Anisotropic filtering in texture sampler, unfortunately ReShade currently does not support anisotropic texture filtering.
When the support is added I will joyfully add it.

For now I suggest using the sharpening effect, like AMD FidelityFX Contrast Adaptive Sharpening (CAS.fx) or FilmicSharpen.fx.
Last edit: 1 year 3 weeks ago by Fu-Bama.

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

  • Fu-Bama
More
4 months 3 weeks ago #4 by Fu-Bama Replied by Fu-Bama on topic linear filtering is blurry, point filtering is aliased
Ok, the latest version of PerfectPerspective uses MipMaps and Anisotropic filtering which eliminates pixelation and blurring.

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.