uniform sampler2D TexScene;
varying vec2 texCoord;
uniform float radius;

float texOffset = 1.0/512.0;

vec4 gaussFilter[9];

void main(void)
{
   float radius2 = 1.0 - 2.0*abs(0.5-texture2D(TexScene, texCoord).a);
   float texScaler = (1.0 - radius2)/256.0*radius;
   vec4 color = vec4(0.0,0.0,0.0,0.0);
   
   gaussFilter[0] = vec4(-4.0, 0.0, 0.0, 01.0/64.0);
   gaussFilter[1] = vec4(-2.0, 0.0, 0.0, 02.0/64.0);
   gaussFilter[2] = vec4(-1.0, 0.0, 0.0, 06.0/64.0);
   gaussFilter[3] = vec4(-0.5, 0.0, 0.0, 14.0/64.0);
   gaussFilter[4] = vec4( 0.0, 0.0, 0.0, 18.0/64.0);
   gaussFilter[5] = vec4( 0.5, 0.0, 0.0, 14.0/64.0);
   gaussFilter[6] = vec4( 1.0, 0.0, 0.0, 06.0/64.0);
   gaussFilter[7] = vec4( 2.0, 0.0, 0.0, 02.0/64.0);
   gaussFilter[8] = vec4( 4.0, 0.0, 0.0, 01.0/64.0);
   
   int i;
   for (i=0;i<9;i++)
   {
      color += texture2D(TexScene,vec2(texCoord.x + gaussFilter[i].x * texScaler + texOffset, texCoord.y + gaussFilter[i].y * texScaler + texOffset)) * gaussFilter[i].w;
   } // End for
   
   color.a = texture2D(TexScene, texCoord).a;
   gl_FragColor = color;
}