#extension GL_ARB_texture_rectangle : enable
uniform sampler2DRect tex0;

uniform float time;


void main() {
  vec2 sp = gl_TexCoord[0].xy;
  vec4 c = texture2DRect( tex0, sp );

  int width = 7;

  vec4 glow = vec4(0,0,0,0);
  for (int i = -width; i < width+1; ++i) 
    for (int j = -width; j < width+1; ++j)  {
      glow += texture2DRect( tex0, sp + vec2(i*2.3,j*2.3) );
    }
          
  glow/= (width*2+1)*(width*2+1);
 

  float f = cos(sp.y)*.5+.5 + cos(sp.x)*.5+.5;

  gl_FragColor = glow*f*.4 +c;
}



