06-11-2016, 11:03 PM
@nover this is just a simple effect, I don't understand this scanline fetish myself, but it's quick to port so ~ catch:
Vertex:
Fragment:
Note it might differ a bit as I had to guess what "rubyTextureSize" exactly is in the emulator you took it from, I also added "size" which you can change to pick different size of those "scanlines".
Just create vsh/fsh files and create an ini file with whatever name you want:
then put all those 3 files into your shaders folder and next time you run ppsspp it should have it on the list, hopefully working unless I made some typo(;p).
If you created the files earlier, make sure to add "OutputResolution=True" for that shader in the ini file, that's kind of important.
Vertex:
Code:
uniform vec2 u_pixelDelta;
attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;
varying vec2 omega;
void main() {
v_texcoord0 = a_texcoord0;
gl_Position = a_position;
omega = 3.141592654 * (1.0/u_pixelDelta);
}Fragment:
Code:
#ifdef GL_ES
precision mediump float;
precision mediump int;
#endif
uniform sampler2D sampler0;
varying vec2 v_texcoord0;
varying vec2 omega;
//configuration (higher values mean brighter image but reduced effect depth)
const float brighten_scanlines = 16.0;
const float brighten_lcd = 4.0;
const float size = 2.0;
void main() {
const vec3 offsets = 3.141592654 * vec3(1.0/2.0,1.0/2.0 - 2.0/3.0,1.0/2.0-4.0/3.0);
vec2 angle = v_texcoord0.xy * omega / size;
float yfactor = (brighten_scanlines + sin(angle.y)) / (brighten_scanlines + 1.0);
vec3 xfactors = (brighten_lcd + sin(angle.x + offsets)) / (brighten_lcd + 1.0);
gl_FragColor.rgb = yfactor * xfactors * texture2D(sampler0, v_texcoord0.xy).rgb;
gl_FragColor.a = 1.0;
}Note it might differ a bit as I had to guess what "rubyTextureSize" exactly is in the emulator you took it from, I also added "size" which you can change to pick different size of those "scanlines".
Just create vsh/fsh files and create an ini file with whatever name you want:
Code:
[LCD3x]
Name=LCD3x
Fragment=name_of_your_file.fsh
Vertex=name_of_your_file.vsh
OutputResolution=TrueIf you created the files earlier, make sure to add "OutputResolution=True" for that shader in the ini file, that's kind of important.
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.
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.

