   {
     float3 depth = make_float3(0.0f, 0.0f, 0.0f);
     // convert position to window-coordinates
-    const float4 depthWin = mulPost(c_MvPrMatrix, make_float4(maxDiffDepth.x, maxDiffDepth.y, maxDiffDepth.z, 1.0f));
+    const float4 depthWin = mulPost(c_MvPrMatrix, make_float4(ibrDepth  .x, ibrDepth  .y, ibrDepth  .z, 1.0f));
     depth = perspectiveDivide(depthWin);
 
     depth.z++;

texture<float4, 1, cudaReadModeElementType> randTexture;

const int NUM_RAND_VECS = 8192;

int iDivUp(const int a, const int b)
{

                       const float3 sphereCenter, const float sphereRadius,
                       const float3 planeNormal, const float planeDist,
                       void* d_depth, vvIbrImage::DepthPrecision dp,
                       const float2 ibrPlanes, const bool alphaPassIbr,
                       const bool gatherPass, float* d_gatheredAlpha)
{
  const float opacityThreshold = 0.95f;

