uniform sampler2D Color0; // the texture with the scene you want to blur
uniform sampler2D Position;

void main(void)
{
   vec4 sum = vec4(0.0);
 
   sum.rgb += texture2D( Color0, gl_TexCoord[0].st ).rgb;
   sum.rgb += texture2D( Color0, gl_TexCoord[1].st ).rgb;
   sum.rgb += texture2D( Color0, gl_TexCoord[2].st ).rgb;
   sum.rgb += texture2D( Color0, gl_TexCoord[3].st ).rgb;
    
   sum.a += texture2D( Position, gl_TexCoord[0].st ).a;
   sum.a += texture2D( Position, gl_TexCoord[1].st ).a;
   sum.a += texture2D( Position, gl_TexCoord[2].st ).a;
   sum.a += texture2D( Position, gl_TexCoord[3].st ).a;

   // position needs to be scaled
   sum.a /= 2000.0;

   gl_FragColor = 0.25 * sum;
}