05-21-2022, 04:06 AM
It looks to me like the built-in Spline36 shader (used for screen upscaling) shifts the ouput by (source-space) half-pixel (i.e. half-pixel in 480x272, assuming 1x internal resolution) towards the upper-left.
That's the behavior I observe in my PPSSPP 1.10.3, but I don't think the shader in question substantionally changed since then.
This can be easily seen just be enabling it, since the image instantly jitters slightly.
The bilinear upscaling (which is not shader-based, I think) does not have this behavior.
As far as I can tell the fix is to change the line
to
in assets/shaders/upscale_spline36.fsh (assets/shaders/upscale_spline36.vsh stays unchanged).
As an aside, I am surprised that PPSSPP does not seem to have a bicubic (e.g. Catmull-Rom) option for screen upscaling out-of-the-box, only bilinear and Spline36 (as well as fancy things like 5xBR), even though there is a bicubic texture upscaling option. The Spline36 may, in fact, incur a noticeable slowdown on a reasonably ancient machine (well, probably anything with a weak GPU). E.g. my straightforward implementation of bicubic upscaling shader does not seem to reduce the FPS on my machine, but Spline36 does.
I can post my Catmull-Rom shader, if anyone is interested.
That's the behavior I observe in my PPSSPP 1.10.3, but I don't think the shader in question substantionally changed since then.
This can be easily seen just be enabling it, since the image instantly jitters slightly.
The bilinear upscaling (which is not shader-based, I think) does not have this behavior.
As far as I can tell the fix is to change the line
Code:
vec2 inputPos = outputPos / u_texelDelta;Code:
vec2 inputPos = outputPos / u_texelDelta - HALF_PIXEL;As an aside, I am surprised that PPSSPP does not seem to have a bicubic (e.g. Catmull-Rom) option for screen upscaling out-of-the-box, only bilinear and Spline36 (as well as fancy things like 5xBR), even though there is a bicubic texture upscaling option. The Spline36 may, in fact, incur a noticeable slowdown on a reasonably ancient machine (well, probably anything with a weak GPU). E.g. my straightforward implementation of bicubic upscaling shader does not seem to reduce the FPS on my machine, but Spline36 does.
I can post my Catmull-Rom shader, if anyone is interested.

