Post Reply 
 
Thread Rating:
  • 11 Votes - 4.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom PPSSPP shaders
03-15-2018, 10:13 AM
Post: #331
RE: Custom PPSSPP shaders
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...


Attached File(s)
.zip  ppsspp_zfast_lcd+psp_color.zip (Size: 16.62 KB / Downloads: 85)
Find all posts by this user
Quote this message in a reply
03-22-2018, 09:59 AM (This post was last modified: 03-29-2018 08:10 AM by jdgleaver.)
Post: #332
RE: Custom PPSSPP shaders
I've updated my shader collection with a few more ports and such - this is probably the last of them now, so I'll stop spamming this thread... Smile

You can get a copy of the final bundle here:
.zip  ppsspp_shader_bundle.zip (Size: 42.23 KB / Downloads: 124)

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:

[LCD1x Sharp] / [LCD1x Sharp + PSP Color]

       

Notes:

- REQUIRES a rendering resolution of 1xPSP

- Runs at full speed on mid-range Android devices

- As with the LCD3x shader, produces decent results at 1360x768:

   
Find all posts by this user
Quote this message in a reply
03-22-2018, 10:32 PM (This post was last modified: 04-04-2018 03:32 PM by LunaMoo.)
Post: #333
RE: Custom PPSSPP shaders
(03-22-2018 09:59 AM)jdgleaver Wrote:  (...)
but it has a hard-coded 'scanline size' parameter
(...)

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

(03-22-2018 09:59 AM)jdgleaver Wrote:  (...)
- REQUIRES a rendering resolution of 1xPSP
(...)

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 soTongue.


~

Quick copy-paste reminder of flags we have:
Code:
RequiresIntSupport=True - when unsure, you most likely don't need it
Upscaling=True - forces x1 render res and nearest screen scaling filter which upscaling filters require
OutputResolution=True - outputs to display res, almost always good thing to have
60fps=True - for animated filters
SSAA=value - forces rendering res to value * display res, combined with blurry filters it's nice, but expensive form of AA.
(edit: added new SSAA flag and some descriptions)

We also have some special uniforms like
Code:
u_time
u_video
u_texelDelta
u_pixelDelta
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).

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
03-23-2018, 09:49 AM
Post: #334
RE: Custom PPSSPP shaders
(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... Wink

(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 soTongue.

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... Undecided
Find all posts by this user
Quote this message in a reply
03-23-2018, 03:08 PM
Post: #335
RE: Custom PPSSPP shaders
(03-23-2018 09:49 AM)jdgleaver Wrote:  (...)
I didn't intend any disrespect towards your 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 .Tongue

(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

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
04-06-2018, 06:18 PM (This post was last modified: 04-06-2018 06:19 PM by Endarko.)
Post: #336
RE: Custom PPSSPP shaders
please port to ppssp
shadersmods.com/chocapic13s-shaders-mod/
Find all posts by this user
Quote this message in a reply
04-07-2018, 03:17 PM
Post: #337
RE: Custom PPSSPP shaders
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.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
04-09-2018, 04:35 AM
Post: #338
RE: Custom PPSSPP shaders
whether shader like this can be used in ppsspp? I've tried changing the name of shaders.vert to shaders.fsh but the game screen becomes a black screen

#version 300 es
precision highp float;
in vec3 position;
in mediump vec3 normal;
in vec2 texcoord;
uniform mat4 u_proj;
uniform mat4 u_world;
uniform mat4 u_view;
uniform vec4 u_uvscaleoffset;
uniform vec3 u_lightpos0;
uniform lowp vec3 u_lightambient0;
uniform lowp vec3 u_lightdiffuse0;
uniform vec3 u_lightpos1;
uniform lowp vec3 u_lightambient1;
uniform lowp vec3 u_lightdiffuse1;
uniform vec3 u_lightpos2;
uniform lowp vec3 u_lightambient2;
uniform lowp vec3 u_lightdiffuse2;
uniform lowp vec4 u_ambient;
uniform lowp vec3 u_matdiffuse;
uniform lowp vec4 u_matspecular;
uniform lowp vec3 u_matemissive;
uniform lowp vec4 u_matambientalpha;
uniform highp vec2 u_fogcoef;
out lowp vec4 v_color0;
out mediump vec3 v_texcoord;
out mediump float v_fogdepth;
void main() {
vec3 worldpos = (u_world * vec4(position.xyz, 1.0)).xyz;
mediump vec3 worldnormal = normalize((u_world * vec4(normal, 0.0)).xyz);
vec4 viewPos = u_view * vec4(worldpos, 1.0);
gl_Position = u_proj * viewPos;
lowp vec4 lightSum0 = u_ambient * u_matambientalpha + vec4(u_matemissive, 0.0);
vec3 toLight;
lowp vec3 diffuse;
mediump float ldot;
toLight = u_lightpos0;
ldot = max(dot(toLight, worldnormal), 0.0);
diffuse = (u_lightdiffuse0 * u_matdiffuse) * ldot;
lightSum0.rgb += (u_lightambient0 * u_matambientalpha.rgb + diffuse);
toLight = u_lightpos1;
ldot = max(dot(toLight, worldnormal), 0.0);
diffuse = (u_lightdiffuse1 * u_matdiffuse) * ldot;
lightSum0.rgb += (u_lightambient1 * u_matambientalpha.rgb + diffuse);
toLight = u_lightpos2;
ldot = max(dot(toLight, worldnormal), 0.0);
diffuse = (u_lightdiffuse2 * u_matdiffuse) * ldot;
lightSum0.rgb += (u_lightambient2 * u_matambientalpha.rgb + diffuse);
v_color0 = clamp(lightSum0, 9.0, 1.0);
v_texcoord = vec3(texcoord.xy * u_uvscaleoffset.xy, 0.0);
v_fogdepth = (viewPos.z + u_fogcoef.x) * u_fogcoef.y;
}
Find all posts by this user
Quote this message in a reply
04-09-2018, 09:31 AM
Post: #339
RE: Custom PPSSPP shaders
Check my post above as it's exactly about stuff like that.

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.

http://forums.ppsspp.org/showthread.php?tid=6594 - Custom PPSSPP Shaders!
http://forums.ppsspp.org/showthread.php?tid=3590&pid=117172#pid117172 - simple CE scripts to help creating CWCheats,
https://github.com/LunaMoo/PPSSPP_workarounds - CWCheat workarounds.
Find all posts by this user
Quote this message in a reply
06-05-2018, 08:13 PM (This post was last modified: 06-05-2018 08:19 PM by ppssp213.)
Post: #340
RE: Custom PPSSPP shaders
Still tweaking, trying not destory the smokey / rainy atmosphere
but give it richer colours for better greens and browns.

               

Code:
#define SHADEBOOST   1         //ON:1/OFF:0 /color correction from GSdx/pcsx2 plugin, initially taken from

http://irrlicht.sourceforge.net/phpBB2/viewtopic.php?t=21057
#define saturation   2.0       //Default: 1.0 //negative will look like inverted colors shader
#define brightness   2.0       //Default: 1.0
#define contrast     1.0       //Default: 1.0 //negative will be... well negative;p
#define red          0.7       //Default: 1.0
#define green        0.7       //Default: 1.0
#define blue         0.7       //Default: 1.0
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: