Pixel-Composer/shaders/sh_sharpen/sh_sharpen.fsh
2023-01-01 08:06:02 +07:00

25 lines
884 B
GLSL

//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
uniform vec2 dimension;
void main() {
vec2 tex = 1. / dimension;
vec4 c = - 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tex.x, -tex.y) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., -tex.y) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( tex.x, -tex.y) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tex.x, 0.) )
+ 9. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., 0.) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( tex.x, 0.) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2(-tex.x, tex.y) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( 0., tex.y) )
- 1. * texture2D( gm_BaseTexture, v_vTexcoord + vec2( tex.x, tex.y) );
gl_FragColor = c;
}