 {
   vec2 center = coverageCircle.xy; // Extract shadow coverage circle center
   float radius = coverageCircle.z; // Extract shadow coverage circle radius
-  int numSamples = 8;
+  int numSamples = 16;
   
-  float visibility = 0.0;
+  float blockers = 0.0;
   
   vec3 sampleTexCoord = texCoord.xyz;
-  float phi = random(texCoord.xy)*TWOPI;
+  float phi = random(coverageCircle.xy)*TWOPI;
 
   // Iterate over all sample points
   for(int i = 0; i < numSamples; ++i)

    sampleTexCoord.xy = center + offset;
    
    float depth = texture2D(depthTex, sampleTexCoord.xy).r;
    visibility += ((depth == (0.5 - planeSign*0.5)) || (planeSign*depth <= planeSign*sampleTexCoord.z)) ? 1.0 : 0.0;
  }
  
  return vec2(visibility, float(numSamples));
}

void main(void)

  
  if(numBlockers == 0) return vec2(-1.0, numBlockerSearchSamples);
  else if (numBlockers == numBlockerSearchSamples) return vec2(-2.0, 0.0);
  else return vec2(Depth2Distance(avgBlockerDepth / numBlockers, zNearFarInv), numBlockerSearchSamples - numBlockers);
}

// Compute visibility of given texture coordinate subject to given shadow coverage circle
