Custom PPSSPP shaders
|
01-03-2016, 12:08 AM
Post: #234
|
|||
|
|||
My new shader - Nintendo DS Auto Contrast like
Hello everyone, here's a shader I came with today. It's a shader inspired by subtle constrast and contouring we can see in some Nintendo DS games. It adds so much clarity in your psp game. Have fun playing games
Fragment Shader File Content uniform sampler2D sampler0; uniform vec2 u_texelDelta; varying vec4 v_texcoord0; void main() { vec3 cu = texture2D(sampler0, v_texcoord0.xy + (vec2(0.0, -1.0) * u_texelDelta)).xyz; vec3 cd = texture2D(sampler0, v_texcoord0.xy + (vec2(0.0, 1.0) * u_texelDelta)).xyz; vec3 cl = texture2D(sampler0, v_texcoord0.xy + (vec2(-1.0, 0.0) * u_texelDelta)).xyz; vec3 cr = texture2D(sampler0, v_texcoord0.xy + (vec2(1.0, 0.0) * u_texelDelta)).xyz; vec3 c = texture2D(sampler0, v_texcoord0.xy).xyz; float lc = max(max(c.r, c.g), c.b); float d=0; float nd=0; nd = max(max(cu.r-c.r, cu.g-c.g), cu.b-c.b); if(nd > d) d=nd; nd = max(max(cd.r-c.r, cd.g-c.g), cd.b-c.b); if(nd > d) d=nd; nd = max(max(cl.r-c.r, cl.g-c.g), cl.b-c.b); if(nd > d) d=nd; nd = max(max(cr.r-c.r, cr.g-c.g), cr.b-c.b); if(nd > d) d=nd; gl_FragColor.xyz = c * (lc - d) / lc; gl_FragColor.a = 1.0; } Vertex Shader File Content attribute vec4 a_position; attribute vec2 a_texcoord0; varying vec4 v_texcoord0; void main() { gl_Position = a_position; v_texcoord0=a_texcoord0.xyxy; } |
|||
« Next Oldest | Next Newest »
|