varying vec2 		texcoord;
varying vec4 		texcoord0;
varying vec4 		texcoord1;
varying vec4 		texcoord2;
varying vec4 		texcoord3;

uniform sampler2D 	tex;
uniform float 		scale;
vec4 				color;

void main()
{
	color =	texture2D(tex, texcoord.xy);
	color += texture2D(tex, texcoord0.xy);
	color += texture2D(tex, texcoord1.xy);
	color += texture2D(tex, texcoord2.xy);
	color += texture2D(tex, texcoord3.xy);
	color += texture2D(tex, texcoord0.zw);
	color += texture2D(tex, texcoord1.zw);
	color += texture2D(tex, texcoord2.zw);
	color += texture2D(tex, texcoord3.zw);

	//vec4 res=color/9.0;
	gl_FragColor.xyz = max(vec3(0.0),/*res.xyz*/scale*(color.xyz/9.0));
}
