hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.16k stars 2.17k forks source link

Low quality result of 5xBR postprocessing shader #9425

Closed RadarNyan closed 7 years ago

RadarNyan commented 7 years ago

I've noticed the 5xBR postprocessing shader in PPSSPP looks poorly comparing to other emulators.

5xbr_ppsspp Here's a scalling result of PPSSPP (window size was set to 3xPSP)

3xbr For comparision, here's the same frame captured then scale using 3xBR algorithm with ScalerTest.exe provided in xBRZ project (I'm not sure which version of xBR it is though, the source for this tool doesn't seem to be available)

In the implement pull request @LunaMoo said it's "A simple and fast variant of 5xBR". I wonder if these artifacts shown above are the result of "simple and fast" or it's caused by a improper implement of the shader or something else in PPSSPP?

Also (not sure if it's related) if I enable 5xBR and set window size to 1xPSP, the result would be terrible. You can repreduce this behavior with any game so I'm not uploading any screenshots. Nothing like that would happen to other upscaling shaders like 4xHQ GLSL / Spline36 Upscaler.

(The game in screenshots above was NPJH90092, trial version of "Misshitsu no Sacrifice" which you can aquire from developer's site)

LunaMoo commented 7 years ago

Upscaling shaders scale from native psp res up to display size, if you use x1 window size, you're not getting any scaling, just rounding algorithm work over native pixels, similar thing happens when using xBRZ with x1 render res(since it will also not be able to scale in such situation). Can't see anything "terrible" on my end with it, through I can't see much details in x1 window size to begin with and I can imagine all it would cause is artifacts.

In other words to some extent the bigger your window/display res, the higher the scaling will be. Optimally you want it in integer multiplier ~ so it looks nice on the most common 1080p display, should also look fine in 4k which is also using integer multiplier. It might not on other displays at least not without zooming in/out with display layout editor to crop the image/add black borders. ~ This is also easy way to test how it looks on different displays.

As for it's quality - it's not really dropped in any way(aside of your display res). There are awfuly lot of variants of this algorithm through. I posted few different variants on the forums before deciding on which to include in ppsspp. Guest recently posted his latest 5xBR accuracy which also includes a few different variants in it's config. The problem is they all handle some graphics better while having problems with others, none is ultimate or best, the variant A is potentially rounding more than it should, but at the same time variants that limit that creates lines where there shouldn't be any, some variations might also include additional smoothing or other effects, the one included in ppsspp is plain 5xBR v3.5a.

Additional notes:

Edit: Here's a link to Guest 5xBR accuracy fixed for dx11 translation. If it looks better on some graphics we could replace it, or include both since it is twice as heavy as the old v3.5a. ~ That archive also includes another shader which is nice at upscaling some graphics AA 4.o Filtro, you have to set it's scale to lower number like 4.0 or slightly lower to get it upscaling anything. The downside aside from being more blurry is that it's even heavier.