 			break;
 		}
 
+		// Generate samples
+		vec4 ColorSample = getColorSample(Iterator);
+		float AlphaSample = ColorSample.a * uStepSize * uAlphaIntensity;
+		
+		// Accumulate
+		ColorAccumulator += (1.0 - AlphaAccumulator / uAlphaIntensity) * ColorSample * AlphaSample * 3;
+		AlphaAccumulator += AlphaSample;
+		LengthAccumulator += length(DirectionStep);
+		
+		// Advance iterator
+		Iterator += DirectionStep;
+
+		// Length test
+		if (LengthAccumulator >= Length)
+		{
+			if (uDebugLevel == 2)
+			{
+				outFragColor = vec4(0, float(i) / float(IterationMax), 1, 1);
+				return;
+			}
+			break;
+		}
+		
 		// Accumulation test
-		if (LengthAccumulator >= Length || AlphaAccumulator > 1.0)
-		{
-			if (uDebugLevel == 2)
-			{
-				outFragColor = vec4(1, 1, 1, 1);
+		if (AlphaAccumulator > uAlphaIntensity)
+		{
+			if (uDebugLevel == 3)
+			{
+				outFragColor = vec4(1, 0, float(i) / float(IterationMax), 1);
 				return;
 			}
 			break;
 		}
-	}
+		
+		if (uDebugLevel == 4 && IterationMax == i + 1)
+		{
+			outFragColor = vec4(0, 0.1, 0.1, 1);
+			return;
+		}
+	}
+	
+	if (uDebugLevel == 4)
+	{
+		outFragColor = vec4(1, 0.5, float(i) / float(IterationMax), 1);
+		return;
+	}
+	
+	ColorAccumulator.r = clamp(ColorAccumulator.r, 0.0, 1.0);
+	ColorAccumulator.g = clamp(ColorAccumulator.g, 0.0, 1.0);
+	ColorAccumulator.b = clamp(ColorAccumulator.b, 0.0, 1.0);
+	ColorAccumulator.a = clamp(ColorAccumulator.a, 0.0, 1.0);
 
 	if (uDebugLevel == 1)
 		outFragColor = vec4(FrontPosition, 1.0);

	switch (uHighlightMode)
	{
	default:
	case 0:
		sample.a = 0.8;
		break;

	case 1:
		vec3 LocalVector = coords - 0.5;
		vec3 PlanarVector = normalize(uSliceAxis);


	vec3 FrontPosition;
	vec3 CameraPosition = (uInvModelMatrix * vec4(uCameraPosition, 1.0)).xyz;
	
	if (CameraPosition.x >= -0.5 &&
		CameraPosition.y >= -0.5 &&
		CameraPosition.z >= -0.5 &&
		CameraPosition.x <=  0.5 &&
		CameraPosition.y <=  0.5 &&
		CameraPosition.z <=  0.5)
	{
		FrontPosition = CameraPosition + vec3(0.5);
