uniform sampler2D tex;
uniform float invTexWidth;


void main()
{	
	vec2 p = gl_TexCoord[0].xy;
	vec2 dp = vec2(invTexWidth, 0.0);
	
	vec3 a = texture2D(tex, p - 2.1428571 * dp).rgb;
	vec3 b = texture2D(tex, p - 0.6 * dp).rgb;
	vec3 c = texture2D(tex, p + 0.6 * dp).rgb;
	vec3 d = texture2D(tex, p + 2.1428571 * dp).rgb;
	vec3 final = vec3(2.0 * 0.21875)  * (a + d)
	           + vec3(2.0 * 0.78125)  * (b + c);	
	gl_FragColor = vec4( final, 1.0 );
	
}