   float maxIntensity = 0.0f;
   float minIntensity = FLT_MAX;
 
+  // If just clipped, shade with the normal of the clipping surface.
+  bool justClippedPlane = false;
+  bool justClippedSphere = false;
+
   for (int i=0; i<maxSteps; ++i)
   {
     // Test for clipping.
-    if ((
-        (clipSphere && (t >= tsnear) && (t <= tsfar)) // Sphere.
-     || (clipPlane && (((t <= tpnear) && (nddot >= 0.0f))
-         || ((t >= tpnear) && (nddot < 0.0f)))) // Plane.
-    ))
-    {
+    const bool clippedPlane = (clipPlane && (((t <= tpnear) && (nddot >= 0.0f))
+                                          || ((t >= tpnear) && (nddot < 0.0f))));
+    const bool clippedSphere = (clipSphere && (t >= tsnear) && (t <= tsfar));
+
+    if (clippedPlane || clippedSphere)
+    {
+      justClippedPlane = clippedPlane;
+      justClippedSphere = clippedSphere;
+
       t += tstep;
       if (t > tfar)
       {

      const float3 Kd = make_float3(0.8f, 0.8f, 0.8f);
      const float3 Ks = make_float3(0.8f, 0.8f, 0.8f);
      const float shininess = 1000.0f;
      src = phong(src, texCoord, L, H, Ka, Kd, Ks, shininess);
    }

    // "under" operator for back-to-front blending

  sample2.z = volume(pos + make_float3(0.0f, 0.0f, DELTA));

  N = normalize(sample2 - sample1);

  if (normal != NULL)
  {
    // Interpolate gradient with normal from clip object (based on opacity).
    N = (*normal * classification.w) + (N * (1.0f - classification.w));
    N = normalize(N);
  }

  const float diffuse = fabsf(dot(L, N));
  const float specular = powf(dot(H, N), shininess);

