   while (!nextFragmentReadStatus && age <= maxAge)
   {
       nextFragmentReadStatus = fetchFragment(ij, age, nextFragment);
-      endPos_eye = nextFragment.eyePos.xyz;
+      endPos_eye = nextFragment.eyePos;
       ++age;
   }
 
   for (--age; age < maxAge; age++)  // all fragments
   {
     currentFragment = nextFragment;
-    vec3 segmentStartPos_eye = endPos_eye;
+    vec4 segmentStartPos_eye = endPos_eye;
     vec4 fragmentColor = currentFragment.color;
     fragmentColor.xyz *= fragmentColor.w;
 

}

vec4 calculateColorOfVolumes(in int activeObjects, in int activeObjectCount,
    in vec4 currentFragmentPos_eye, in vec3 segmentStartPos_eye,
    in vec3 endPos_eye, in vec4 fragmentColor)
{
  float segmentTextureLength  = calculateSegmentTextureLength(activeObjectCount,
      activeObjects, currentFragmentPos_eye, vec4(endPos_eye, 1.0));
  int sampleSteps = int(segmentTextureLength * STEP_FACTOR);
  sampleSteps = clamp(sampleSteps, 1, MAX_SAMPLES - 1);
  float stepFactor = 1.0 / float(sampleSteps);

  // set up segment direction vector
  vec3 direction_eye = endPos_eye - segmentStartPos_eye;
  vec3 startPos_eye = segmentStartPos_eye;  // + noise offset;

  // sample ray segment
  for (int step = 0; step < sampleSteps; step++)
  {
    vec4 sampleColor = calculateSampleColor(activeObjects,
        activeObjectCount, vec4(startPos_eye, 1.0f));

    // sample accumulation
    fragmentColor = fragmentColor + sampleColor * (1.0f - fragmentColor.w);

    if (fragmentColor.w > alphaThresholdForDepth)
    {
      setPositionAndDepth(vec4(startPos_eye, 1));
    }

    // early ray termination

    --age;

    endPos_eye = nextFragmentReadStatus ?
      nextFragment.eyePos : segmentStartPos_eye;

    if (activeObjectCount > 0)
    {
