     updateActiveObjects(objectId, activeObjects);
     activeObjectCount = bitCount(activeObjects);
 
-    if (nextFragmentReadStatus && objectId == 0 && position.w == -2)
+    if (objectId == 0 && fragmentColor.w > alphaThresholdForDepth &&
+        position.w == -2)
     {
       setPositionAndDepth(currentFragment.eyePos);
     }

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

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

uniform mat4 inverseViewMatrix;
uniform vec3 textureAtlasSize;
uniform vec3 sampleDistance;
uniform float alphaThresholdForDepth = 0.1;

uniform sampler3D volumeSampler;

