anchor.diff:      float depth = texture(kinect_depths, vec3(pos_calib.xy, float(i))).r;
       float quality = 0.0f;
       // blend if in valid depth range
  -    if(abs(depth - pos_calib.z) < limit) {
  +    float dist = abs(depth - pos_calib.z);
  +    if(dist < limit) {
         quality = texture(kinect_qualities, vec3(pos_calib.xy, float(i))).r;
       }
   
  
positive.code:   }
    return weights;
  }
  
  vec4 blendColors(const in vec3 sample_pos) {
    vec3 total_color = vec3(0.0f);
    float total_weight = 0.0f;
    float[5] weights = getWeights(sample_pos);
    for(uint i = 0u; i < num_kinects; ++i) {
      vec3 pos_calib = texture(cv_xyz_inv[i], sample_pos).xyz;
      vec2 pos_color = texture(cv_uv[i], pos_calib).xy;
      vec3 color = texture(kinect_colors, vec3(pos_color.xy, float(i))).rgb;
  
      total_color += color * weights[i];
      total_weight += weights[i];
    }
    total_color /= total_weight;
    if(total_weight <= 0.0f) return vec4(vec3(0.0), -1.0);
    return vec4(total_color, 1.0);
  }
  
  vec3 blendNormals(const in vec3 sample_pos) {
    vec3 total_color = vec3(0.0f);
    float total_weight = 0.0f;
    float[5] weights = getWeights(sample_pos);
    for(uint i = 0u; i < num_kinects; ++i) {
      vec3 pos_calib = texture(cv_xyz_inv[i], sample_pos).xyz;
      vec3 color = texture(kinect_normals, vec3(pos_calib.xy, float(i))).rgb;
  
      total_color += color * weights[i];
      total_weight += weights[i];
    }
  
    total_color /= total_weight;
    return total_color;
  }
  
  vec3 blendCameras(const in vec3 sample_pos) {
  
negative.code: 
  vec3 get_gradient(const vec3 pos);
  float sample(const vec3 pos);
  vec3[5] getColors(const in vec3 sample_pos);
  vec3[5] getNormals(const in vec3 sample_pos);
  vec4 blendColors(const in vec3 sample_pos);
  vec4 blendColors2(const in vec3 sample_pos);
  vec3 blendNormals(const in vec3 sample_pos);
  vec3 blendCameras(const in vec3 sample_pos);
  // cube-ray intersection from http://prideout.net/blog/?p=64
  