      float ruPx = texture2D(inputImage, ruTexCoord).r;
      float rcPx = texture2D(inputImage, rcTexCoord).r;
      float rdPx = texture2D(inputImage, rdTexCoord).r;

      float h = -luPx - 2.0 * lcPx - ldPx + ruPx + 2.0 * rcPx + rdPx;
      float v = -luPx - 2.0 * cuPx - ruPx + ldPx + 2.0 * cdPx + rdPx;

      float mag = length(vec2(h, v));

      fragColor = vec4(vec3(mag), 1.0);
    }
  