Post Reply 
 
Thread Rating:
  • 11 Votes - 4.64 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Custom PPSSPP shaders
10-31-2013, 04:54 PM
Post: #106
RE: Custom PPSSPP shaders
Updated the link in original post Smile Also removed OGL2Lookup which was useless.
Find all posts by this user
Quote this message in a reply
10-31-2013, 05:15 PM
Post: #107
RE: Custom PPSSPP shaders
(10-31-2013 04:54 PM)Danyal Zia Wrote:  Updated the link in original post Smile Also removed OGL2Lookup which was useless.

Thanks Alot!

SmileSmileBig GrinBig Grin

Works Nice Cool

....

Need now shader: AA Shader v2.o - Daisy

Angel Please
Find all posts by this user
Quote this message in a reply
10-31-2013, 05:16 PM (This post was last modified: 10-31-2013 05:19 PM by naoan.)
Post: #108
RE: Custom PPSSPP shaders
(10-31-2013 03:37 PM)Combone Wrote:  @Danyal Zia

Shaders...
Must be converted again Sad

New version of PPSSPP cause Blackscreen.

EDIT:

This Shaders...

AA Shader v2.o
AA Shader v2.o - Daisy
AA shaders AA Shader v2.o - Bloom


Cause blackscreen too Sad

Here's the updated version of my port (along with the requested aa 2d 3d, which look bad btw Tongue) http://www.mediafire.com/?m01rx1t6czuvju3

Just unpack it to assets/shaders folder, delete the old shaders file and the entries inside the defaultshaders.ini if you have it, I've put it inside the extra.ini so it would not get overwritten if you update your ppsspp.
Find all posts by this user
Quote this message in a reply
10-31-2013, 05:40 PM (This post was last modified: 10-31-2013 06:16 PM by Combone.)
Post: #109
RE: Custom PPSSPP shaders
(10-31-2013 05:16 PM)naoan Wrote:  
(10-31-2013 03:37 PM)Combone Wrote:  @Danyal Zia

Shaders...
Must be converted again Sad

New version of PPSSPP cause Blackscreen.

EDIT:

This Shaders...

AA Shader v2.o
AA Shader v2.o - Daisy
AA shaders AA Shader v2.o - Bloom


Cause blackscreen too Sad

Here's the updated version of my port (along with the requested aa 2d 3d, which look bad btw Tongue) http://www.mediafire.com/?m01rx1t6czuvju3

Just unpack it to assets/shaders folder, delete the old shaders file and the entries inside the defaultshaders.ini if you have it, I've put it inside the extra.ini so it would not get overwritten if you update your ppsspp.

Angel

Thanks Smile

Go Go Test Big Grin

.............

EDIT:

Tested..

Shy

AA Shader + Natural Vision

[Image: svrx.png]
[Image: kbc4.png]

*************

AA 2D+3D GLSL

[Image: vkti.png]
Find all posts by this user
Quote this message in a reply
11-01-2013, 05:45 PM
Post: #110
RE: Custom PPSSPP shaders
About StoryBook Shader..

Someone has tested? (PPSSPP Emulator Huh )..

Shader demonstration..





.....

[Image: db3.jpg]
Find all posts by this user
Quote this message in a reply
11-05-2013, 02:23 AM
Post: #111
RE: Custom PPSSPP shaders
Hello all. This is my first post in the PPSSPP community! Big Grin

Anyway, I downloaded PPSSPP so that I could emulate Birth By Sleep (actually purchased Birth By Sleep on Amazon for the purpose).
As I played it, I realized there was one thing missing - when I played KH1 and 2, I played them on those old NTSC televisions. I wanted to replicate that feel as a post process shader, and I'm nearly there.
There is just one thing I need - is there any way to get some kind of time value in the shader? I want to scroll the scanlines over time, but have no idea how.
Any help?
Find all posts by this user
Quote this message in a reply
11-05-2013, 08:54 AM
Post: #112
RE: Custom PPSSPP shaders
Hm, sorry there's no time value yet, might add one though.
Find all posts by this user
Quote this message in a reply
11-05-2013, 09:39 AM
Post: #113
RE: Custom PPSSPP shaders
(11-05-2013 02:23 AM)KillaMaaki Wrote:  Hello all. This is my first post in the PPSSPP community! Big Grin

Anyway, I downloaded PPSSPP so that I could emulate Birth By Sleep (actually purchased Birth By Sleep on Amazon for the purpose).
As I played it, I realized there was one thing missing - when I played KH1 and 2, I played them on those old NTSC televisions. I wanted to replicate that feel as a post process shader, and I'm nearly there.
There is just one thing I need - is there any way to get some kind of time value in the shader? I want to scroll the scanlines over time, but have no idea how.
Any help?

Can't you just do some loop from top to bottom pixel until it reset back to top periodically? Not sure if that's what you want though.
Find all posts by this user
Quote this message in a reply
11-05-2013, 04:17 PM (This post was last modified: 11-06-2013 05:56 AM by KillaMaaki.)
Post: #114
RE: Custom PPSSPP shaders
(11-05-2013 09:39 AM)naoan Wrote:  
(11-05-2013 02:23 AM)KillaMaaki Wrote:  Hello all. This is my first post in the PPSSPP community! Big Grin

Anyway, I downloaded PPSSPP so that I could emulate Birth By Sleep (actually purchased Birth By Sleep on Amazon for the purpose).
As I played it, I realized there was one thing missing - when I played KH1 and 2, I played them on those old NTSC televisions. I wanted to replicate that feel as a post process shader, and I'm nearly there.
There is just one thing I need - is there any way to get some kind of time value in the shader? I want to scroll the scanlines over time, but have no idea how.
Any help?

Can't you just do some loop from top to bottom pixel until it reset back to top periodically? Not sure if that's what you want though.

That's the thing though - without a time value I can't do any animation in the shader.
I actually prototyped this shader with the Unity game engine first - there they expose a global _Time vector which contains various multiples of the current time. I use that to offset scan position per pixel (which scrolls the scanlines).

To give a bit more detail on the shader, it first calculates scanlines - per pixel it's either 1 or 0, forming horizontal stripes.
It uses that to offset UV position, so on 1 it offsets a few pixels to the right, on 0 it doesn't offset. Makes it look a bit like those staggered phosphor TVs.
It also splits the red and green channels, shifting each left and right slightly to kind of simulate NTSC color bleed.

It actually looks really good when I animate the scanlines (in my Unity prototype), but without the animation it kind of looks boring.

EDIT: Actually, on a side note, anybody know how to implement multipass shaders? Thinking about porting over an actual NTSC shader, but they're all 3-pass and I'm unsure how to do this with PPSSPP.

EDIT 2: Got the first pass of the NTSC shader ported. Currently looks exactly like what happens when you connect a Y cable to a composite connection (you get a grayscale image with a few color artifacts/bleeding)

EDIT 3: Here's a prototype I made with the Unity game engine
https://dl.dropboxusercontent.com/u/9910...TDemo.html
It's off by default, hit "Toggle NTSC" to turn it on/off.

If I could make a multipass shader in PPSSPP (and have access to some kind of Time or frame count value) I would really love to get this ported over.
Find all posts by this user
Quote this message in a reply
12-02-2013, 06:22 AM
Post: #115
RE: Custom PPSSPP shaders
will there be more shaders ? or like can we add ones from epsxe emulator or will they not work ?

Try AntiMicro graphical program used to map keyboard keys and mouse controls to a gamepad/controller.
http://forums.ppsspp.org/showthread.php?tid=12513
or http://www.x360ce.com
Find all posts by this user
Quote this message in a reply
12-02-2013, 04:53 PM
Post: #116
RE: Custom PPSSPP shaders
Just a small(?) news - we can use time value now in our shaders.
Code:
v0.9.5-824-g7c7c4aa    Henrik Rydgård    2013-12-02 17:24:20    Add "u_time" uniform to postprocessing shaders.

basically set a
Code:
uniform vec4 u_time;
list of parameters from the code page:
float time[4] = {time_now(), (vCount % 60) * 1.0f/60.0f, (float)vCount, (float)(flipCount % 60)};

Tested it by setting one effect to show every second frame and seems to work, althrough I have no idea about using it to improve graphics, guess it was made on @KillaMaaki request ~ good luck with your NTSC shader^_^, multipass is still not possible or so I guess.

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
12-05-2013, 08:34 PM (This post was last modified: 12-06-2013 10:55 AM by Kokoro.)
Post: #117
RE: Custom PPSSPP shaders
Hi.
Like LunaMoo I was trying to merge two shaders: FXAA with Natural, but I'm not good with this and cant menage Natural shader to work together with FXAA shader. If someone could help me, with what is wrong in my code, and could improve it to work, I would be grateful.

fsh file
Code:
//================
//Extra options:
#define FXAA         1         //ON:1/OFF:0
//================
#define NATURAL      1         //ON:1/OFF:0
//================

#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif

uniform sampler2D sampler0;
uniform sampler2D sampler1;
varying vec4 v_texcoord1;
varying vec4 v_texcoord2;
varying vec4 v_texcoord3;
varying vec4 v_texcoord4;

// The inverse of the texture dimensions along X and Y
uniform vec2 u_texelDelta;
varying vec2 v_texcoord0;

//================
void main()
{
  // The parameters are hardcoded for now, but could be
  // made into uniforms to control fromt he program.
#if(FXAA==1)
  float FXAA_SPAN_MAX = 8.0;
  float FXAA_REDUCE_MUL = 1.0/8.0;
  float FXAA_REDUCE_MIN = (1.0/128.0);

  vec3 rgbNW = texture2D(sampler0, v_texcoord0.xy + (vec2(-1.0, -1.0) * u_texelDelta)).xyz;
  vec3 rgbNE = texture2D(sampler0, v_texcoord0.xy + (vec2(+1.0, -1.0) * u_texelDelta)).xyz;
  vec3 rgbSW = texture2D(sampler0, v_texcoord0.xy + (vec2(-1.0, +1.0) * u_texelDelta)).xyz;
  vec3 rgbSE = texture2D(sampler0, v_texcoord0.xy + (vec2(+1.0, +1.0) * u_texelDelta)).xyz;
  vec3 rgbM  = texture2D(sampler0, v_texcoord0.xy).xyz;
    
  vec3 luma = vec3(0.299, 0.587, 0.114);
  float lumaNW = dot(rgbNW, luma);
  float lumaNE = dot(rgbNE, luma);
  float lumaSW = dot(rgbSW, luma);
  float lumaSE = dot(rgbSE, luma);
  float lumaM  = dot( rgbM, luma);
    
  float lumaMin = min(lumaM, min(min(lumaNW, lumaNE), min(lumaSW, lumaSE)));
  float lumaMax = max(lumaM, max(max(lumaNW, lumaNE), max(lumaSW, lumaSE)));
    
  vec2 dir;
  dir.x = -((lumaNW + lumaNE) - (lumaSW + lumaSE));
  dir.y =  ((lumaNW + lumaSW) - (lumaNE + lumaSE));
    
  float dirReduce = max((lumaNW + lumaNE + lumaSW + lumaSE) * (0.25 * FXAA_REDUCE_MUL), FXAA_REDUCE_MIN);
      
  float rcpDirMin = 1.0/(min(abs(dir.x), abs(dir.y)) + dirReduce);
    
  dir = min(vec2(FXAA_SPAN_MAX,  FXAA_SPAN_MAX),
        max(vec2(-FXAA_SPAN_MAX, -FXAA_SPAN_MAX), dir * rcpDirMin)) * u_texelDelta;
        
  vec3 rgbA = (1.0/2.0) * (
              texture2D(sampler0, v_texcoord0.xy + dir * (1.0/3.0 - 0.5)).xyz +
              texture2D(sampler0, v_texcoord0.xy + dir * (2.0/3.0 - 0.5)).xyz);
  vec3 rgbB = rgbA * (1.0/2.0) + (1.0/4.0) * (
              texture2D(sampler0, v_texcoord0.xy + dir * (0.0/3.0 - 0.5)).xyz +
              texture2D(sampler0, v_texcoord0.xy + dir * (3.0/3.0 - 0.5)).xyz);
  float lumaB = dot(rgbB, luma);

  if((lumaB < lumaMin) || (lumaB > lumaMax)){
    gl_FragColor.xyz=rgbA;
  } else {
    gl_FragColor.xyz=rgbB;
  }
  gl_FragColor.a = 1.0;
}

const mat3 RGBtoYIQ = mat3(0.299, 0.596, 0.212,
                           0.587,-0.275,-0.523,
                           0.114,-0.321, 0.311);

const mat3 YIQtoRGB = mat3(1.0, 1.0, 1.0,
                           0.95568806036115671171,-0.27158179694405859326,-1.1081773266826619523,
                           0.61985809445637075388,-0.64687381613840131330, 1.7050645599191817149);

const vec3 val00 = vec3( 1.2, 1.2, 1.2);

void second()
{
#if(NATURAL==1)
vec3 c0,c1;

c0 = texture2D(sampler1,v_texcoord1.xy).xyz;
c0+=(texture2D(sampler1,v_texcoord1.zy).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord1.xw).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord1.zw).xyz)*0.125;

c0+= texture2D(sampler1,v_texcoord2.xy).xyz;
c0+=(texture2D(sampler1,v_texcoord2.zy).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord2.xw).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord2.zw).xyz)*0.125;

c0+= texture2D(sampler1,v_texcoord3.xy).xyz;
c0+=(texture2D(sampler1,v_texcoord3.zy).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord3.xw).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord3.zw).xyz)*0.125;

c0+= texture2D(sampler1,v_texcoord4.xy).xyz;
c0+=(texture2D(sampler1,v_texcoord4.zy).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord4.xw).xyz)*0.25;
c0+=(texture2D(sampler1,v_texcoord4.zw).xyz)*0.125;
c0*=0.153846153846;

c1=RGBtoYIQ*c0;

c1=vec3(pow(c1.x,val00.x),c1.yz*val00.yz);

gl_FragColor.xyz=YIQtoRGB*c1;

}

vsh file
Code:
uniform vec4 u_texelDelta;

attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;
varying vec4 v_texcoord1;
varying vec4 v_texcoord2;
varying vec4 v_texcoord3;
varying vec4 v_texcoord4;

void main()
{
  v_texcoord0 = a_texcoord0;
  gl_Position = a_position;

  v_texcoord1=a_texcoord0.xyxy+vec4(-0.5,-0.5,-1.5,-1.5)*u_texelDelta.xyxy;
  v_texcoord2=a_texcoord0.xyxy+vec4( 0.5,-0.5, 1.5,-1.5)*u_texelDelta.xyxy;
  v_texcoord3=a_texcoord0.xyxy+vec4(-0.5, 0.5,-1.5, 1.5)*u_texelDelta.xyxy;
  v_texcoord4=a_texcoord0.xyxy+vec4( 0.5, 0.5, 1.5, 1.5)*u_texelDelta.xyxy;
}
Find all posts by this user
Quote this message in a reply
12-06-2013, 01:21 PM
Post: #118
RE: Custom PPSSPP shaders
void main() is the return function, you have to mix both shaders there, also vsh file of natural ~ vertex shader had a small, but confusing bug:
Code:
uniform vec4 u_texelDelta;
should be
Code:
uniform vec2 u_texelDelta;
;p since it only returns 2 parameters and vec4 was either a typo or error on the author side most likely. As even below where it's used:
Code:
u_texelDelta.xyxy;
it only uses 2 parametersTongue.

Joined them myself now ~ you can download and see how I did it.

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
12-06-2013, 03:31 PM
Post: #119
RE: Custom PPSSPP shaders
Now I understand what's going on. Thanks for the response and help, now I know how to combine shaders with each other. +1 Rep for you Wink
Find all posts by this user
Quote this message in a reply
12-09-2013, 07:07 PM
Post: #120
RE: Custom PPSSPP shaders
* Brothers!
* i need a little help.
* this is my first try to use custom shaders i got from browsing the whole thread.
* i cant make it work Sad

* im using latest build u can see on buildbot.
* on android.
* i extracted the files in sdcard > PSP > shaders
* then opened ppsspp.
* when i select the " PostP Shader " button in the options
* ppsspp crashes.
* shaders i tried can be found on the first page.

Reality is a Lovely Place, But i Wouldn't Wanna Live There..
• • gLoBe ~
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump: