
uniform sampler2D colortex;
uniform float radiusx;
uniform float radiusy;
uniform float minus, mult;

void main(void) {
  vec4 a, b, c;

  a = texture2D(colortex, vec2(gl_TexCoord[0].x-radiusx, gl_TexCoord[0].y-radiusy))*0.125+
      texture2D(colortex, vec2(gl_TexCoord[0].x        , gl_TexCoord[0].y-radiusy))*0.25+
  	  texture2D(colortex, vec2(gl_TexCoord[0].x+radiusx, gl_TexCoord[0].y-radiusy))*0.125;

  b = texture2D(colortex, vec2(gl_TexCoord[0].x-radiusx, gl_TexCoord[0].y))*0.25+
      texture2D(colortex, vec2(gl_TexCoord[0].x        , gl_TexCoord[0].y))*0.5+
	  texture2D(colortex, vec2(gl_TexCoord[0].x+radiusx, gl_TexCoord[0].y))*0.25;

  c = texture2D(colortex, vec2(gl_TexCoord[0].x-radiusx, gl_TexCoord[0].y+radiusy))*0.125+
      texture2D(colortex, vec2(gl_TexCoord[0].x        , gl_TexCoord[0].y+radiusy))*0.25+
	  texture2D(colortex, vec2(gl_TexCoord[0].x+radiusx, gl_TexCoord[0].y+radiusy))*0.125;

  gl_FragColor = ((a+b+c)*0.5-minus)*mult;
}

