   {
     currentFragment = nextFragment;
     vec4 segmentStartPos_eye = endPos_eye;
+    float startDistance = endDistance;
     vec4 fragmentColor = currentFragment.color;
     fragmentColor.rgb *= fragmentColor.w;
 

      {
        finalColor = blend(finalColor, currentFragment.color);
      }
      /*
      setPositionAndDepth(endPosCut_eye);
      outputColor = blend(clamp(finalColor, vec4(0.0), vec4(1.0)), vec4(backgroundColor, 1.0));
      segmentStartPos_eye = endPosCut_eye;
      */
    }
    else
    {

    if (activeObjectCount > 0)
    {

  }

  vec4 world = inverseViewMatrix * endPos_eye;
  float endDistance = dot(world, farPlane);
  if (endDistance < 0)
  {
    setPositionAndDepth(viewMatrix * vec4(world.xyz - endDistance * farPlane.xyz, 1.0f));
    outputColor = vec4(backgroundColor, 1);
    /*
    // to prevent case of maxAge == 1 at the end
