varying vec2 		texcoord;
uniform sampler2D 	tex;
uniform vec2		ofs;
vec4 				color;
uniform float		sharpen;

void main()
{
	color=texture2D(tex,texcoord);

	// sharpening /////////////////////////
	vec4 sharpened=color*5.0;
	sharpened-=texture2D(tex, texcoord.xy-vec2(0.0,ofs.y));
	sharpened-=texture2D(tex, texcoord.xy+vec2(0.0,ofs.y));
	sharpened-=texture2D(tex, texcoord.xy-vec2(ofs.x,0.0));
	sharpened-=texture2D(tex, texcoord.xy+vec2(ofs.x,0.0));
	
	gl_FragColor.xyz = mix(color.xyz,sharpened.xyz,sharpen);
}
