
uniform sampler2D t_color;
uniform vec2 radius;
uniform float bias;
uniform float scale;


void main(void) {
  vec2 texcoord = gl_TexCoord[0].xy;
  vec4 col = vec4(0.0);

  // loop unrolled cause ati sucks ass
  col += texture2D(t_color, texcoord-6.0*radius)*0.002216;
  col += texture2D(t_color, texcoord-5.0*radius)*0.008764;
  col += texture2D(t_color, texcoord-4.0*radius)*0.026995;
  col += texture2D(t_color, texcoord-3.0*radius)*0.064759;
  col += texture2D(t_color, texcoord-2.0*radius)*0.120985;
  col += texture2D(t_color, texcoord-1.0*radius)*0.176033;
  col += texture2D(t_color, texcoord           )*0.199471;
  col += texture2D(t_color, texcoord+1.0*radius)*0.176033;
  col += texture2D(t_color, texcoord+2.0*radius)*0.120985;
  col += texture2D(t_color, texcoord+3.0*radius)*0.064759;
  col += texture2D(t_color, texcoord+4.0*radius)*0.026995;
  col += texture2D(t_color, texcoord+5.0*radius)*0.008764;
  col += texture2D(t_color, texcoord+6.0*radius)*0.002216;

  col = clamp((col + bias) * scale, 0.0, 1.0);
  gl_FragColor = col;
}



