         // Update the minimum value if necessary
         value = min(tValue, value);
 
+        if (i >= count) { break; }
         posIS += stepIS;
-        if (i >= count) { break; }
       }
 
       // Perform the last step along the ray using the

        // Update the maximum value if necessary
        value = max(tValue, value);

        posIS += stepIS;
        if (i >= count) { break; }
      }

      // Perform the last step along the ray using the

    }

    tColor = getColorForValue(value, posIS, tstep);

    gl_FragData[0] = tColor;
  #endif
