Skip to content

Screen upscaling shaders improvements #15566

Closed
@fp64

Description

@fp64

What should happen

Actually, 2 issues rolled into one.

First, the current implementation of Spline36 seems to shift the display by 1/2 of (source-space) pixel toward upper-left. At least it does on my (admittedly convoluted) setup: win32 PPSSPP (tested on ppsspp-v1.12.3-1215-g3bf0c0088-windows-x86) under wine, using OpenGL (independent confirmation would be nice).
The fix seems to be replacing
vec2 inputPos = outputPos / u_texelDelta;
by
vec2 inputPos = outputPos / u_texelDelta - HALF_PIXEL;
in assets/shaders/upscale_spline36.fsh.

Second, it might be nice to have more screen upscaling shaders out-of-the-box. Currently this is either (not shader-based) bilinear, or Spline36 (not counting something like 5xBR).
Some form of bicubic (e.g. Catmull-Rom) screen upscaling might be nice, as Spline36 can be a bit slow on a sufficiently ancient machine (it is on mine).
In case anyone is interested, here are my implementations of Catmull-Rom and Mitchell-Netravali upscalers (.fsh only, since .vsh is the same as Spline36):
Catmull-Rom:
https://pastebin.com/2BKMG11Q
Mitchell-Netravali:
https://pastebin.com/vtdXgyVw
WARNING: not tested much, basically gutted Spline36 code.
I personally prefer Catmull-Rom visually (for upscaling, anyway).
I don't expect them to be better than Spline36 quality-wise.

Who would this benefit

Probably most people using upscaling shaders (albeit slightly).
People with older hardware.

Platform (if relevant)

No response

Games this would be useful in

Any.

Other emulators or software with a similar feature

No response

Checklist

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions