     endPos_eye = nextFragmentReadStatus ?
       nextFragment.eyePos : segmentStartPos_eye;
 
-    vec4 world = inverseViewMatrix * vec4(endPos_eye, 1);
+    vec4 world = inverseViewMatrix * endPos_eye;
     float dist = dot(world, farPlane);
     if (dist < 0)
     {
-      endPos_eye = (viewMatrix * vec4(world.xyz - dist * farPlane.xyz, 1.0f)).xyz;
+      vec4 endPosCut_eye = viewMatrix * vec4(world.xyz - dist * farPlane.xyz, 1.0f);
+      /*
       nextFragmentReadStatus = false;
       // to prevent case of maxAge == 1 at the end
       age = ++maxAge;
+      */
+      if (activeObjectCount > 0)
+      {
+        fragmentColor = calculateColorOfVolumes(activeObjects, activeObjectCount,
+            segmentStartPos_eye, segmentStartPos_eye, endPosCut_eye, fragmentColor);
+        finalColor = finalColor + fragmentColor * (1.0f - finalColor.a);
+      }
+      else
+      {
+        finalColor = blend(finalColor, currentFragment.color);
+      }
+      outputColor = blend(clamp(finalColor, vec4(0.0), vec4(1.0)), vec4(backgroundColor, 1.0));
+      setPositionAndDepth(endPosCut_eye);
+      segmentStartPos_eye = endPosCut_eye;
     }
 
     if (activeObjectCount > 0)

      ++age;
  }

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

  for (--age; age < maxAge; age++)  // all fragments

    position.xyz = ndcPos.xyz;
    position.w = 1.0f;
  }
  else if (position2.w == POSITION_NOT_SET)
  {
    vec4 ndcPos = projectionMatrix * positionInEyeSpace;
    ndcPos = ndcPos / ndcPos.w;
    float depth = ndcPos.z;
    gl_FragDepth = depth;
    position2 = ndcPos;
  }
}

vec4 calculateSampleColor(in uint remainingActiveObjects, in int activeObjectCount,
