   if (nextFragmentReadStatus)
   {
     finalColor = blend(finalColor, nextFragment.color);
-    if (nextFragment.color.a > alphaThresholdForDepth)
+    if (finalColor.a > alphaThresholdForDepth &&
+        getDepth(layerIndex) == DEPTH_NOT_SET)
     {
       setPositionAndDepthFor(layerIndex, nextFragment.eyePos);
     }
+
     float endDistance = dot(nextFragment.eyePos, layerPlanes[layerIndex]);
     while (endDistance < 0 && layerIndex < planeCount)
     {
       setColorForLayer(layerIndex, finalColor);
+      if (getDepth(layerIndex) == DEPTH_NOT_SET)
+        setPositionNdc(layerIndex, vec4(1));
       finalColor = vec4(0);
       ++layerIndex;
       endDistance = dot(nextFragment.eyePos, layerPlanes[layerIndex]);

  uvec2 ij = uvec2(pos.xy);

  gl_FragDepth = 1.0;

  uint maxAge = counters[Saddr(ij)];


  }

  setColorForLayer(layerIndex, finalColor);
  if (getDepth(layerIndex) == DEPTH_NOT_SET)
    setPositionNdc(layerIndex, vec4(1));

  for (++layerIndex; layerIndex < layerCount; ++layerIndex)
