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
Video: implement output resampling (upscaling/downscaling) methods #11999
Video: implement output resampling (upscaling/downscaling) methods #11999
Conversation
7fe5467
to
530f172
Compare
a632745
to
50124b9
Compare
|
I can't say much about the shader code, but this is a really good improvement to image quality when downsampling, it's always been pretty terrible before. This actually makes resolutions above the screen size worth using. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I can't actually test this right now, on account of my computer being in pieces atm. But I can just review the UX!
Also it feels really weird to have gamma correction in the dropdown for scaling methods but, if that's how the hardware works then I guess that's that. If you could give me a quick explanation on that I'd appreciate it.
|
I've merged SamB changes into the branch and solved all the remaining issues mentioned above. There is still a minor issue with area resampling where it shifts the output image by half a pixel but it's barely noticeable and SamB will fix that later. |
3b98e70
to
9be77ef
Compare
8b5c927
to
ee2a49e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looked over the GLSL code and the tool tip.
LGTM
221506b
to
8058236
Compare
|
Looks like I introduced a conflict here when I switched the tooltip for the Color Correction button to our fancy ones. Can you rebase? |
8058236
to
561fc1d
Compare
Edited by Filoppi
Edited by Filoppi
… when upscaling and downscaling
…penGL This was because the shader uniforms between the pixel and vertex shaders were willingly left different, to avoid filling the vertex shader with unnecessary params. Turns out all backends are fine with this except OGL. The new behaviour is now much more consistent and well explained, the "default" shaders are the ones that always run, and the non default ones are the user selected ones (if any).
561fc1d
to
80b4530
Compare
|
@AdmiralCurtiss done. |
Hi @Filoppi, first of all thank you for adding this awesome feature! Being able to select the output filtering modes is really something every emulator should have imho. So my suggestion would be to maybe add the nearest neighbor filtering back to the menu? All the pixel purists out there would greatly appreaciate it, I'm sure! 🙏 Best regards 😊 |
|
@Frieslover69 there's an explanation in this blog post regarding the downsides of a "pure" Nearest Neighbor filter in older consoles like the GC/Wii and that's why we're not providing it as an option... |
|
@mbc07 Thanks for the reply! Yeah, I'm aware of the downsides of nearest neighbor. But some things might be considered before ultimately abandoning that feature:
So... do you think NN has a chance of getting accepted if someone submits a pull-request? The code for the filter is still in the default_pre_post_process.glsl file, so adding it back would only need a relatively small change. And the first post even says everyone is free to add their own filters. 😊 |
|
@Frieslover69 leaving nearest neighbor has been discussed at length and we decided against (I'm not as against it as others). We are aware there are some positives of keeping it, but at the same time, it's also extremely easy for users to re-enable it by just commenting out in These kind of discussions are probably best had on discord, join the devs channel there if you want to have further discussion, or just make a PR to add back nearest neighbor. |



Follow up to:
#11850
This PR implements custom upscaling/downscaling techniques in our default post process pass.
By default no custom resampling is done, Dolphin just falls back on the GPU hardware (bi)linear sampling (which has no effect unless the emulation output (XFB) resolution doesn't match the window resolution).
If the user selects any resampling method other than default, then the default post process pass will be executed, and it will do some custom resampling (before any other user selected post process), with gamma correction (colors are converted to linear space before resampling).
I have implemented a multitude of algorithms, all of them have been rigorously tested and checked against each other and against many other code bases (e.g. Cemu, Yuzu, DXVK, github random samples, ...).

There's no "best" resampling method so each user can select what they prefer depending on the case.
Given that resampling is optional and that Dolphin doesn't have major performance issues, the shaders might not be as optimized as they could, but for now I'd say there isn't much to worry about.
Everybody is welcome to add new resampling methods, and the Catmull-Rom is basically a template for any other bicubic algorithms.
Upscaling (from 1x):






Downscaling (from 8x):






New Box Resampling (for downscaling) by @Sam-Belliveau.


Box might look a bit less "sharp", but it's extremely termporal stable if the source resolution is high enough.
More samples:
#12018