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
10.95k stars 2.13k forks source link

xBR 3D shader #12150

Open bajolzas opened 5 years ago

bajolzas commented 5 years ago

Not sure if this is the right place to ask but is it possible to add an xbr 3d shader to ppsspp (in like it filters 2d sprites but ignores 3d polygons)?

I'm using such a shader in pcsxr (.slf/.slv) and it look pretty nice. For some reason when using a similar named shader in retroarch's beetle it doesnt look that nice, but for ppsspp I cant even find anything that fits that description.

As an example here's a pic: xbr3d pcsxr

as you can see it filters 2d elements but 3d stuff is unfiltered. This would greatly help games like Valkyrie Profile or Breath of Fire III, that dont work that well with the texture filter

LunaMoo commented 5 years ago

We already have texture scaling which does exactly that and PPSSPP was likely one of the first emulators to even have such feature althrough because it's done on CPU for performance reasons it does not apply to constantly modified textures.

Compute shader version of texture scaling might eventually happen, we already have a pull request with proof of concept for such way in #10818 and a slightly different approach in #10393 that will basically be a per-texture shader like I guess the thing you're requesting, but for now texture scaling via cpu is the only thing you can get in PPSSPP.

Not sure if we need this opened since technically we already have pull requests and will to provide something alike in the future, but it probably wasn't ever requested so might as well leave it.

bajolzas commented 5 years ago

it isnt really a per texture scaler, it's a fullscreen shader that simply ignores 3d assets. more info here: https://forums.libretro.com/t/filtering-games-with-2d-and-3d-elements/3964

I am asking this because per texture filtering sometimes causes bugs (like in valkyrie profile) and the delay is also kinda distracting in some games.

isnt there a way to convert glsl shader to work on ppsspp? never managed to get how it is supposed to be done...

unknownbrackets commented 5 years ago

It is possible to apply shaders after rendering is complete, but not "only on 2D elements." It just applies to the final rendered screen. You can already use custom shaders there.

It's unfortunately far less obvious on the PSP whether a game is drawing 2D or 3D than you might think. See #7232 for a technical discussion on this.

Bloom and other things complicate this. Games also mix drawing, and draw things in patches. A lot of these problems are responsible for the issues with higher resolutions you already call out - they are the same problems that make it hard to detect 2D vs 3D drawing.

Imagine that the HP/MP numbers and portrait were drawn in "3D mode" (but for some reason, drawing each 1/4 of the portrait separately), but the names and HP/MP labels were in "2D mode".

Maybe that sounds silly, but that easily might be the result of heuristics about whether graphics are 2D or not in games. All game developers cared about was getting it to look right on the PSP screen. Whatever took less time and money to build, and ran at an acceptable FPS (usually 30 FPS.)

-[Unknown]

LunaMoo commented 5 years ago

Seems like Hyllian's actually did make it via a post process, however: