 
     if (nextFragmentReadStatus && objectId == 0 && position.w == -2)
     {
-      vec4 ndcPos = projectionMatrix * nextFragment.eyePos;
-      ndcPos = ndcPos / ndcPos.w;
-      float depth = ndcPos.z;
-      gl_FragDepth = depth;
-      position.xyz = ndcPos.xyz;
-      position.w = 1.0f;
+      setPositionAndDepth(currentFragment.eyePos);
     }
 
     // fetch next Fragment

  return segmentTextureLength;
}

void main()
{
  o_PixColor = vec4(0);


        if (fragmentColor.w > 0.1 && position.w == -2)
        {
          setPositionAndDepth(vec4(startPos_eye, 1));
        }

        // early ray termination
        if (fragmentColor.w > 0.999)
          break;
