   float endDistance = dot(endPos_eye, layerPlanes[layerIndex]);
   while (endDistance < 0)
   {
-    vec4 newPosition =
-        vec4(endPos_eye.xyz - endDistance * layerPlanes[layerIndex].xyz, 1.0f);
-    setPositionAndDepthFor(layerIndex, newPosition);
+    setPositionNdc(layerIndex, vec4(1));
     setColorForLayer(layerIndex, vec4(0));
     ++layerIndex;
     endDistance = dot(endPos_eye, layerPlanes[layerIndex]);

    }
  }


  setColorForLayer(layerIndex, finalColor);

  for (++layerIndex; layerIndex < layerCount; ++layerIndex)
  {
    setColorForLayer(layerIndex, vec4(0));
    setPositionNdc(layerIndex, vec4(0));
  }
}


          segmentStartPos_eye, endPos_eye, fragmentColor, depth);
      finalColor = finalColor + fragmentColor * (1.0f - finalColor.a);

      if (depth != DEPTH_NOT_SET)
        setPositionNdc(layerIndex, vec4(depth, depth, depth, 1));
    }
    else
    {
