#version 120
varying vec2 uv;

uniform float texelSize;
uniform sampler2D w;

void main()
{
  vec4 wL = texture2D(w, uv - vec2(texelSize, 0));
  vec4 wR = texture2D(w, uv + vec2(texelSize, 0));
  vec4 wB = texture2D(w, uv - vec2(0, texelSize));
  vec4 wT = texture2D(w, uv + vec2(0, texelSize));

  gl_FragColor = vec4(0.5 * ((wR.x - wL.x) + (wT.y - wB.y)), 0, 0, 0);
}