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
Post-processing: Add integer scaling shader #10722
Conversation
|
The shader itself looks OK quality-wise now, and seems to work fine ingame. It doesn't behave properly if the internal resolution is set high enough that the window needs to be shrunken, but I don't think that's something you need to handle currently. For consistency with the other files, it should probably be named |
|
Ok. maybe I'll take a little more time and work on it. Pretty sure I can do automatic downscaling to fit high IR in the window. |
|
Let me know if you're missing any functionality to make this work as well as you'd like, I'm not wanting to bloat the post processing PR too much but I do want to account for various use cases. |
|
I'm very surprised everything I'm wanting is already accessible. I think we're good for this subject. Still improving on it. |
|
I figured out how to do options. I didn't want to do too many, and I can't make UI option groups to show checking multiple boxes might be pointless. I can add more options depending on what people think. When the UI system gets reworked it'll get dropdown boxes and stuff. |
|
The current implementation only does a downsample in the shader. Is that correct? We don't allow scaling of the post processing texture in master (it is supported in my post processing overhaul PR). I have no idea if the integer logic is correct or even accurate. I was hoping @phire would review this, as they commented on the original support ticket. EDIT: also curious if there was any research on other implementations. For my post processing PR, I've been trying to prune our shader list. I really want to adopt shaders that are used in other emulators, reshade, etc and only create new ones if they are better or provide different features. |
It sets the dimensions to the xfb so the pixels are square, then it can be integer scaled up or down, so the result is square pixels as well. I don't think there is any reason to upscale, but it's just present in the simple logic. If comparing the result to an xfb dump, they look exactly the same.
I'm not sure about this, it seems scalable.
The person who requested this said it does what is needed for his CRT.
I was just following the basic logic of integer scaling and the result appeared to turn out correctly, which fixed a CRT issue. I think most implementations are through render logic and not a shader, but our PP has the xfb as input and the window size as output, so it works. I felt like it's easier to put in all the requested features as a shader with a load of options. So this provides a feature not typically added as a PP shader, but the output is the same as my integer scaling rendering PR #10720. It keeps getting requested as a feature on the boards. |
1c44b84
to
f92322a
Compare
|
Cleaned up the options, This is everything I want in it, unless someone asks for more. I also added a width scale slider for Virtual Console games that have a xfb with a very wide width vs height. |
f92322a
to
d9ea1e4
Compare
|
@iwubcode Actually calling it an integer scaler is slightly misleading. The IR setting does the integer upscaling. This shader just outputs the image without any stretching, which is otherwise not possible. It can do a simple integer downscale if needed though. As a side note: It's rather simple to make a NN integer upscaling shader, but I don't think anyone needs it. For pixel-y games the IR seems to do pretty much that. |
Feature request: https://bugs.dolphin-emu.org/issues/12725
Integer Scaling scales based on xfb * IR and adds black bars on all sides if needed.
There is probably a way to have the shader downscale/upscale so it isn't locked, but I couldn't get it right and I think shader options are broken.