-
Notifications
You must be signed in to change notification settings - Fork 603
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix multiple issues with resampling #879
base: main
Are you sure you want to change the base?
Conversation
Any comparison screenshots? |
Sorry, I don't, to be honest I haven't even tried this. I'm pretty sure about fix 1 and 3 though, you could run some screenshots yourself if you want. |
Ah ok, it's appreciated regardless. I will test it myself when I get a chance. |
I believe that working with the output/target resolution for the Hermite resampling makes it more downsampling friendly, because it picks 16 samples for each output pixel, but these 16 samples aren't aligned with the source image (the emulation output), thus you could be skipping source samples. |
@Exzap my PR is now ready and tested: |
this makes the shader consistent with hermite and fixes the wrong offset
makes the shader look a lot better and less pixelated
1 ) It seems like there's a mistake in the Hermite bicubic filtering implementation. My change is based on the reference sources, and it also seems to make more sense, I don't see how squaring the inverse texture size would make sense. I don't think this change was on purpose, as the variable was called doubleSize, not squaredSize.
Sources:
https://www.shadertoy.com/view/MllSzX
https://www.shadertoy.com/view/XdGXWt
2 )
BicubicHermiteTexture
was based on the output resolution instead of the rendering resolution.3 ) The bilinear filtering was not offet by 0.5 and it would either have wrong results, or shift the output by a pixel.