precision highp float;
uniform sampler2D u_image;
uniform float u_scale;
uniform vec2 u_texSize;
varying vec2 v_texCoord;

vec4 Avg5(in sampler2D image, in vec2 texCoord, in vec2 pixelSize) {
  vec4 C0 = texture2D(image, texCoord );
  vec4 C1 = texture2D(image, texCoord + vec2(pixelSize.x, pixelSize.y));
  vec4 C2 = texture2D(image, texCoord + vec2(pixelSize.x, -pixelSize.y));
  vec4 C3 = texture2D(image, texCoord + vec2(-pixelSize.x, pixelSize.y));
  vec4 C4 = texture2D(image, texCoord + vec2(-pixelSize.x, -pixelSize.y));
  return (C0 + C1 + C2 + C3 + C4) / 5.0;
}

void main() {
  gl_FragColor = Avg5(u_image, v_texCoord, u_texSize);
}