 
     if (fragmentColor.a > alphaThresholdForDepth)
     {
+      depth = fromEyeToNdcSpace(startPos_eye).z;
       gl_FragDepth = fromEyeToNdcSpace(startPos_eye).z;
     }
 


    if (activeObjectCount > 0)
    {
      fragmentColor = calculateColorOfVolumes(activeObjects, activeObjectCount,
          segmentStartPos_eye, endPos_eye, fragmentColor);
      finalColor = finalColor + fragmentColor * (1.0f - finalColor.a);
    }
    else
    {

}

vec4 calculateColorOfVolumes(in int activeObjects, in int activeObjectCount,
    in vec4 segmentStartPos_eye, in vec4 endPos_eye, in vec4 fragmentColor, inout float depth)
{
  float segmentTextureLength  = calculateSegmentTextureLength(activeObjectCount,
      activeObjects, segmentStartPos_eye, endPos_eye);
