 #define HIZ_STOP_LEVEL       0
 #define MAX_ITERATIONS       48
 #define MAX_THICKNESS        0.001
+
+// Set to 1 to disable HiZ and perform naive linear search.
+#define DEBUG_LINEAR_SEARCH  0
 
 // --------------------------------------------------------
 // Input

	vec3 d = v * maxTraceDistance;

	int level = HIZ_START_LEVEL;
	uint iterations = 0;
	bool isBackwardRay = v.z < 0;
	float rayDir = isBackwardRay ? -1.0 : 1.0;

		if (crossed) {
			ray = intersectCellBoundary(o, d, oldCellIx, cellCount, crossStep, crossOffset);
			level = min(maxLevel, level + 1);
#if DEBUG_LINEAR_SEARCH
			level = 0;
#endif
		} else {
			ray = tempRay;
			level = level - 1;
