 uniform vec3 sampleDistance;
 uniform float alphaThresholdForDepth = 0.1;
 const int layerCount = 4;
-uniform vec4 layerCuts = vec4(-0.15, 0, 0.1, 0);
 uniform vec4 layerPlanes[layerCount - 1];
 
 uniform sampler3D volumeSampler;

      nextFragment.eyePos : segmentStartPos_eye;

    vec4 world = inverseViewMatrix * endPos_eye;
    endDistance = dot(world, layerPlane1);
    if (startDistance >= 0 && endDistance < 0)
    {
      vec4 startWorld = inverseViewMatrix * segmentStartPos_eye;
      vec3 dir = world.xyz - startWorld.xyz;
      float alpha = - dot(startWorld, layerPlane1) / dot(dir, layerPlane1.xyz);
      vec4 endPosCut_eye = viewMatrix * (startWorld + alpha * vec4(dir, 0));
      if (activeObjectCount > 0)
      {

  if (maxAge == 0)
    discard;  // no fragment, early exit

  int activeObjects = 0;
  FragmentData currentFragment;
  FragmentData nextFragment;
