         fragmentColor =
             fragmentColor + sampleColor * (1.0f - fragmentColor.w);
 
+        if (fragmentColor.w > 0.1 && position.w == -2)
+        {
+          vec4 ndcPos = projectionMatrix * vec4(startPos_eye, 1);
+          ndcPos = ndcPos / ndcPos.w;
+          float depth = ndcPos.z;
+          gl_FragDepth = depth;
+          position.xyz = ndcPos.xyz;
+          position.w = 1.0f;
+        }
         // early ray termination
         if (fragmentColor.w > 0.999)
           break;

    objectId = currentFragment.objectId;
    updateActiveObjects(objectId, activeObjects);
    activeObjectCount = bitCount(activeObjects);

    // fetch next Fragment
    nextFragmentReadStatus = false;

  uvec2 ij = uvec2(pos.xy);
  uint32_t pix = (ij.x + ij.y * u_ScreenSz);

  gl_FragDepth = 1.0;
  position = vec4(-2, -2, 1, -2);

  uint maxAge = u_Counts[Saddr(ij)];

