#vertexshader

void main()
{
	gl_Position = ftransform();
	gl_TexCoord[0] = gl_MultiTexCoord0;
}

#fragmentshader

uniform vec2 scale;
//uniform sampler2DRect Texture0;
uniform sampler2D Texture0;

void main()
{
	vec2 s = scale; //vec2(1.0/512.0, 1.0/512.0);
	/*
	gl_FragColor = (
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 1.0, 0.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2(-1.0, 0.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 0.0, 1.0)*s) +
		texture2DRect(Texture0, gl_TexCoord[0].xy+vec2( 0.0,-1.0)*s)) / 4.0;
		*/

	gl_FragColor = (
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.5, 0.0)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2(-0.5, 0.0)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.0, 0.5)*s) +
		texture2D(Texture0, gl_TexCoord[0].xy+vec2( 0.0,-0.5)*s)) / 4.0;

	//gl_FragColor = texture2D(Texture0, gl_TexCoord[0].xy);
	//gl_FragColor = texture2DRect(gl_TexCoord[0].xy*vec2(1.0/640.0,1.0/480.0),0,0);
	//gl_FragColor = vec4(gl_TexCoord[0].xy,0,0);
}
