The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 795 - File: showthread.php PHP 7.4.33 (Linux)
File Line Function
/showthread.php 795 errorHandler->error





Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Spline36 appears to shift the output
05-21-2022, 04:06 AM
Post: #1
Spline36 appears to shift the output
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
Code:
    vec2 inputPos = outputPos / u_texelDelta;
to
Code:
    vec2 inputPos = outputPos / u_texelDelta - HALF_PIXEL;
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.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Spline36 appears to shift the output - FordPerfect - 05-21-2022 04:06 AM

Forum Jump: