uniform sampler2D normalMap;

void main()
{	
   float   h1 = 0.5 / 800.0;         
   float   h2 = 0.5 / 600.0;          

   vec4  val = vec4(0);
   vec2	lookupVec;

   // average with 9 pixels
   for ( int i = -1; i <= 1; i++ )
      for ( int j = -1; j <= 1; j++ ){
         lookupVec = gl_TexCoord [0].xy + vec2 (float(2*i+1)*h1, float(2*j+1)*h2);
         val += texture2D(normalMap, lookupVec);
      }

      vec4 N = texture2D(normalMap, gl_TexCoord[0].xy) ;
      gl_FragColor = val / 9.0 * N;
      gl_FragColor.a = 0.0;
}