mirror of
https://github.com/libretro/ppsspp.git
synced 2025-03-03 06:06:35 +00:00
Two more post processing shaders just for fun. Vignette looks pretty nice.
This commit is contained in:
parent
b56cf00015
commit
dbc1c66c48
assets/shaders
@ -12,4 +12,14 @@ Vertex=natural.vsh
|
||||
Name=Grayscale
|
||||
Author=Henrik
|
||||
Fragment=grayscale.fsh
|
||||
Vertex=fxaa.vsh
|
||||
[Vignette]
|
||||
Name=Vignette
|
||||
Author=Henrik
|
||||
Fragment=vignette.fsh
|
||||
Vertex=fxaa.vsh
|
||||
[InverseColors]
|
||||
Name=Inverse Colors
|
||||
Author=Henrik
|
||||
Fragment=inversecolors.fsh
|
||||
Vertex=fxaa.vsh
|
19
assets/shaders/inversecolors.fsh
Normal file
19
assets/shaders/inversecolors.fsh
Normal file
@ -0,0 +1,19 @@
|
||||
// Simple false color shader
|
||||
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
void main() {
|
||||
vec3 rgb = texture2D(sampler0, v_texcoord0.xy).xyz;
|
||||
float luma = dot(rgb, vec3(0.299, 0.587, 0.114));
|
||||
vec3 gray = vec3(luma, luma, luma) - 0.5;
|
||||
rgb -= vec3(0.5, 0.5, 0.5);
|
||||
|
||||
gl_FragColor.rgb = saturate(mix(rgb, gray, 2.0) + 0.5);
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
16
assets/shaders/vignette.fsh
Normal file
16
assets/shaders/vignette.fsh
Normal file
@ -0,0 +1,16 @@
|
||||
// Simple false color shader
|
||||
|
||||
#ifdef GL_ES
|
||||
precision mediump float;
|
||||
precision mediump int;
|
||||
#endif
|
||||
|
||||
uniform sampler2D sampler0;
|
||||
varying vec2 v_texcoord0;
|
||||
|
||||
void main() {
|
||||
float vignette = 1.1 - 0.6 * (dot(v_texcoord0 - 0.5, v_texcoord0 - 0.5) * 2.0);
|
||||
vec3 rgb = texture2D(sampler0, v_texcoord0.xy).xyz;
|
||||
gl_FragColor.rgb = vignette * rgb;
|
||||
gl_FragColor.a = 1.0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user