     averageIPScalarRangeMin.a = tValue.a;
     averageIPScalarRangeMax.a = tValue.a;
 
-    if (all(greaterThanEqual(tValue, averageIPScalarRangeMin)) &&
-    all(lessThanEqual(tValue, averageIPScalarRangeMax))) {
+    if (valueWithinScalarRange(tValue, averageIPScalarRangeMin, averageIPScalarRangeMax)) {
       sum += tValue;
     }
 

return tColor;
}



//=======================================================================
// Apply the specified blend mode operation along the ray's path.

    tValue = getTextureValue(posIS);

    // One can control the scalar range by setting the AverageIPScalarRange to disregard scalar values, not in the range of interest, from the average computation
    if (valueWithinScalarRange(tValue, averageIPScalarRangeMin, averageIPScalarRangeMax)) {
      sum += tValue;

      stepsTraveled++;
