     objectId = currentFragment.objectId;
     updateActiveObjects(objectId, activeObjects);
     activeObjectCount = bitCount(activeObjects);
+
+    if (nextFragmentReadStatus && objectId == 0 && position.w == -2)
+    {
+      vec4 ndcPos = projectionMatrix * nextFragment.eyePos;
+      ndcPos = ndcPos / ndcPos.w;
+      float depth = ndcPos.z;
+      gl_FragDepth = depth;
+      position.xyz = ndcPos.xyz;
+      position.w = 1.0f;
+    }
 
     // fetch next Fragment
     nextFragmentReadStatus = false;

        fragmentColor =
            fragmentColor + sampleColor * (1.0f - fragmentColor.w);

        // early ray termination
        if (fragmentColor.w > 0.999)
          break;

      ++age;
  }

  for (--age; age < maxAge; age++)  // all fragments
  {
    currentFragment = nextFragment;
