 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;

  }

  vec4 world = inverseViewMatrix * endPos_eye;
  float endDistance = dot(world, layerPlane1);
  if (endDistance < 0)
  {
    setPositionAndDepth(viewMatrix * vec4(world.xyz - endDistance * layerPlane1.xyz, 1.0f));
    outputColor = vec4(0);
  }
  endDistance = dot(world, layerPlane2);
  if (endDistance < 0)
  {
    setPositionAndDepth(viewMatrix * vec4(world.xyz - endDistance * layerPlane2.xyz, 1.0f));
    outputColor2 = vec4(0);
  }
  endDistance = dot(world, layerPlane3);
  if (endDistance < 0)
  {
    setPositionAndDepth(viewMatrix * vec4(world.xyz - endDistance * layerPlane3.xyz, 1.0f));
    outputColor3 = vec4(0);
  }

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

  }
}

void setColorForLayer(int layerIndex, vec4 color)
{
  if (layerIndex == 0)
    outputColor = color;
  else if (layerIndex == 1)
    outputColor2 = color;
  else if (layerIndex == 2)
    outputColor3 = color;
  else
    outputColor4 = color;
}

vec4 calculateSampleColor(in uint remainingActiveObjects, in int activeObjectCount,
    in vec4 startPos_eye)
{
