Skip to content
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

Combine bicubic upscale shaders #17294

Closed
2 tasks done
fp64 opened this issue Apr 16, 2023 · 4 comments
Closed
2 tasks done

Combine bicubic upscale shaders #17294

fp64 opened this issue Apr 16, 2023 · 4 comments
Milestone

Comments

@fp64
Copy link
Contributor

fp64 commented Apr 16, 2023

What should happen

Back when both shaders were introduced there was a comment:

In general having tons of effects providing similar results is just cluttering interface and makes user experience worse by adding choices which actually doesn't matter, which is why I never proposed my shader pack to be merged into PPSSPP, but also why my shader pack includes customizable options and tweaks within every shader instead of providing X versions of each similar algorithm.

This struck a note with me, because having two separate bicubic filters does feel awkward. And now that I think about it, I can just combine them into a single, configurable, shader.

Both "Bicubic (Catmull-Rom) Upscaler" and "Bicubic (Mitchell-Netravali) Upscaler" shaders are members of Mitchell-Netravali class of filters (paper), which are parametrized by a pair of coefficients B, C, so it fits fits nicely into PPSSPP's 4 shader parameters as float4 u_setting setup. Live preview (so to speak) feature of PPSSPP also should work nicely with this.

Now, this would probably be somewhat slower (disappointing, considering I introduced these as a lightweight replacement for Spline36) since you would need to calculate weight coefficients on the fly rather than hardcode them, but I expect it to be rather minor, since most of the time is probably spent on 16 texture lookups anyway.

I can do a PR (probably defaulting unified shader to Catmull-Rom), but here I'm just gathering opinions whether this is worthwhile to do at all. Do people even use these shaders (I tend to just use 1x internal + nearest filtering myself, for maximum blocky Authentic Experience™, even in 3D games)?

Who would this benefit

People who care about bicubic upscalers would be able to tune them just right, and people who don't would have one less "bicubic whatever" option cluttering the menu.

Platform (if relevant)

None

Games this would be useful in

Other emulators or software with a similar feature

No response

Checklist

@iota97
Copy link
Contributor

iota97 commented Apr 17, 2023

While I agree there a bit too many similar shader I think much depends on how much semantic meaning these coefficients have. Can you define a user friendly name for them?

In general parameters tuning is quite the opposite of UX.

@fp64
Copy link
Contributor Author

fp64 commented Apr 17, 2023

The official names for the coefficients are "B" and "C" respectively. The usual figure for visual quality is
quality
I think it is reasonable to vaguely call B something like "blurriness" (or similar, like "smoothness"), but it is harder to come up with a good name for C. If you follow the paper's suggestion and force B+2*C=1, then you need only one coefficient (and name for it).

In general parameters tuning is quite the opposite of UX.

I imagine only "advanced users" would be doing some tuning, and most would be ok with the default. E.g. I don't think I've seen a single case where Catmull-Rom didn't look straight-up better between the two current bicubic shaders on a PSP game (but, of course, "look better" is subjective, and I have only one data point that's not my own (that one is in texture upscaling topic, but the filters are the same)). It is sharper, and while it is supposed to have more ringing, it never seemed problematic.
So having tunable coefficients would be more like a "bonus"/"escape hatch" for the default shader.

@iota97
Copy link
Contributor

iota97 commented Apr 17, 2023

I wouldn't mind a single parameter for 1-B called "sharpness". Blurriness make me feel like some user would just set it to 0 'cuz he don't want blurriness :)

Anyway I don't have a really strong opinion on this.

@fp64
Copy link
Contributor Author

fp64 commented Apr 20, 2023

Can be closed now.

@unknownbrackets unknownbrackets added this to the v1.15.0 milestone Apr 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants