       float segmentTextureLength = 0.0;
       for (int oi = 0; oi < activeObjectCount; oi++)
       {
-        int currentObjectId = findLSB(remainingActiveObjects);
-        remainingActiveObjects &= (~(1 << currentObjectId));
+        int currentObjectId = calculateNextObjectId(remainingActiveObjects);
 
         vec4 textureStartPos = volumes[0].textureMatrix * inverseViewMatrix *
                                currentFragment.eyePos;

          for (int objectIndex = 0; objectIndex < activeObjectCount;
               objectIndex++)
          {
            int currentObjectId = findLSB(remainingActiveObjects);
            if (currentObjectId < 0)
              break;
            remainingActiveObjects &= (~(1 << (currentObjectId)));

            float squareGradientLength = 0.0f;


                              vec2(density, volumes[volumeId].transferFunctionRow));
}

int calculateNextObjectId(inout uint remainingActiveObjects)
{
  int currentObjectId = findLSB(remainingActiveObjects);
  remainingActiveObjects &= (~(1 << (currentObjectId)));

  return currentObjectId;
}

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