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

  }

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

    {
      finalColor = blend(finalColor, currentFragment.color);
    }

    if (finalColor.a > 0.999)
      break;
