Just for fun, I've also ported the 'psp-color' shader from RetroArch. This applies colour correction to replicate the LCD dynamics of the PSP 1000 and PSP 2000 displays. Basically, this fixes the oversaturated colours you sometimes get as a result of developers 'overcompensating' for the limited colour gamut of the original PSP models (it's not as significant an issue for the PSP as it is for the GBA or NDS, but it still makes games look a little garish by default).

The attached zip file is a bundle containing all my shaders so far: the 'psp-color' shader, my zfast_lcd port and hybrid shaders that combine the two effects. As before, there are standard and 'mobile' versions (please see the previous post for more details).

Here are a couple of random examples of the shaders in action:

--- BUST A MOVE DELUXE

With the "zfast LCD Shader":

With the "zfast LCD + PSP Color" shader:

Note how the colour correction makes the greens more natural, and removes the lurid purpleness of the background.

--- WipEout Pulse

With no shader:

With the "PSP Color" shader:

Without colour correction, the background highlights are all purple. With colour correction applied, you can see that they are supposed to be a mixture of purple and blue.

---

I guess the effects are fairly subtle, but I think it's worth playing around with...

It contains my existing 'PSP Color' and 'zfast LCD' variants, plus the following new additions:

=== Bead ===

This is a port of the 'bead' shader from RetroArch, which turns each pixel into a round bead. The native PSP resolution is actually too high for this to work entirely as it should (unless you have a 4k+ display), but it still produces quite a nice clean, crisp result:

[Bead] / [Bead + PSP Color]

Notes:

- REQUIRES a rendering resolution of 1xPSP

- REQUIRES a display resolution of at least 1080p

- Runs at full speed on mid-range Android devices

=== Dot ===

This is a port of the 'dot' shader from RetroArch, which produces an LCD effect with a sort of cosy glow to it:

[Dot] / [Dot + PSP Color]

Notes:

- REQUIRES a rendering resolution of 1xPSP

- REQUIRES a display resolution of at least 1080p

- This is quite a 'heavy' shader, intended for Desktop use. I've included a 'mobile' version (for Android, as I have with all the shaders), but you'll struggle to run it at full speed unless you have a beastly device.

=== LCD3x ===

This is a port of the LCD3x shader from RetroArch.

NB: There is already a version of this in LunaMoo's superb shader collection, but it has a hard-coded 'scanline size' parameter which doesn't match the pitch of the PSP screen. This shader just fixes that one issue, and adds a 'PSP Color' variant.

[LCD3x] / [LCD3x + PSP Color]

Notes:

- REQUIRES a rendering resolution of 1xPSP

- Runs at full speed on mid-range Android devices

- Does *not* require a 1080p display! This shader produces decent results (i.e. no unbearable aliasing effects) at 1360x768, so it's quite good for potato laptops:

=== LCD1x Sharp ===

Personally, I don't like blurry shaders, and the the colour separation of LCD3x gives me a massive headache... so I made a 'tweaked' version that is 'sharp' and which omits the 3-band LCD colour effect:

I would say there's nothing hardcoded in any post process shader loaded externally from text file;p, but also "scanline size" is actually a define right under the option to activate the effect, left there specially to be messed with.;p

Hint: as long as it doesn't depend on linear screen scaling filter(which overall makes image blurry when stretched from x1 to higher display/window res) you can simply add "upscaling" flag to shader ini file as it forces x1 render res and nearest screen scaling filter ~ it's required for upscaling filters, but can be used freely for any effects which have similar requirement. This will avoid manual switching of resolution and bothering people to remember about doing so.

which combined with flags above can make some otherwise impossible things easy, all are used in at least one default effect to see example usage. For example u_time can be used for animations and 60fps flag makes it constant even when game native fps drops down(loading screens for example can often drop to 0 fps which would pause the animation).

(03-22-2018 10:32 PM)LunaMoo Wrote: I would say there's nothing hardcoded in any post process shader loaded externally from text file;p, but also "scanline size" is actually a define right under the option to activate the effect, left there specially to be messed with.;p

You are of course correct! I didn't intend any disrespect towards your work! What I meant to say is that the 'scanline size' value in your shader has to be entered by hand, whereas it's just as easy to determine the 'correct' value automatically...

(03-22-2018 10:32 PM)LunaMoo Wrote: Hint: as long as it doesn't depend on linear screen scaling filter(which overall makes image blurry when stretched from x1 to higher display/window res) you can simply add "upscaling" flag to shader ini file as it forces x1 render res and nearest screen scaling filter ~ it's required for upscaling filters, but can be used freely for any effects which have similar requirement. This will avoid manual switching of resolution and bothering people to remember about doing so.

I realise this is true (and I used it for some of the shaders)... but at least for me, running under Linux (OpenSUSE), the 'upscaling' flag is rather unreliable - half the time I have to switch to another shader and back again before the 1xPSP resolution is enforced. It may be a bother to set the resolution manually, but at least that way I can be sure it's going to work...

Don't worry and don't treat me like an rotten egg. I'm not oversensitive nor delicate.;p Frankly the only time I felt disrespected here was when some dude took my work, edited default values changing options half of which were counter productive or even intentionally disabling each other which he didn't even understand and posted a link to his site filled with advertisement which had a link behind even more advertisement to grab his edited shader;p. Aka I'm not a fan of people earning money of other people's work released for free, doesn't matter how they change it and how they choose to charge for it, parteon, invasive ads, or any other bullshit popular among some greedy people who make excuses on having to pay for hosting costs etc is really the only thing I can't stand and unfortunately it became a thing in "emulation" due to rise in popularity .

(03-23-2018 09:49 AM)jdgleaver Wrote: (...)
ut at least for me, running under Linux (OpenSUSE), the 'upscaling' flag is rather unreliable - half the time I have to switch to another shader and back again before the 1xPSP resolution is enforced
(...)

If you have problem with it, best if you open an issue on PPSSPP issue tracker might be some linux specific problem possibly some race issue as I recall linux behaving differently from windows during resizing which was never properly fixed yet.

The flag was always reliable on windows, through from some time I mostly used d3d11 backend which ofc is not an option for linux users.;c

You can forget about post processing filters from moddable games, they're using a lot of game specific uniforms and can't be ported, because PPSSPP does not provide nor have the information they're based on.

Maybe it would be possible to provide more specific information via some addition to texture replacement or something, but nothing like that exists currently and even if someone would make it possible(which would be a lot of work aka might never happen), it would require a lot of manual work for each game from the user to make use of any effect using such extra information. And even then it would most likely be impossible to reproduce everything which native moddable game has.

Simple request. Is it possible to port the sharp-bilinear-simple shader from libretro to PPSSPP? All it does is prescale the image by nearest neighbor integer scaling as high as possible under the current display resolution, and then uses hardware bilinear scaling to do the rest. Extremely useful for 2D games, and it has effectively no performance cost under modern hardware.

I'd do it myself, since the GLSL code doesn't seem to need rewriting, but I don't know how to split it into explicit fragment and vertex shaders as PPSSPP requires. (I also don't know if it'd be Vulkan compatible, and I'd like to use this with my Android phone as well.)

I can't link the shader because of account restrictions, but it's sharp-bilinear-simple.glsl under the libretro/glsl-shaders repo on GitHub. That or I'll just post the entire code here:

Code:

/*
Author: rsn8887 (based on TheMaister)
License: Public domain

This is an integer prescale filter that should be combined
with a bilinear hardware filtering (GL_BILINEAR filter or some such) to achieve
a smooth scaling result with minimum blur. This is good for pixelgraphics
that are scaled by non-integer factors.

The prescale factor and texel coordinates are precalculated
in the vertex shader for speed.
*/

Hello. Thanks for all your wonderful work guys. Thanks to you, my games are looking absolutely gorgeous (like ps2.5). I wanted to combine the effects of my two favorite shaders "fxaa_nat_bloom" and "cartoon shader I" from the epsxe pack (both of which are I can't do without now. Thumbs up to the creators.) but to no avail. So if one of you experts can do this for me, I'd be eternally grateful.

After playing Liberty City Stories on PCSX2 emulator, I finally got to play Chinatown wars on PPSSPP emulator.
And what I'm missing here is scanlines filter variant that was presented there.
Its called: diagonal filter.
So my question will be: is it possible to modify current scanline shader to add an angle, or it will be easier to write down new one (port from PCSX2)?