   // Calc hits with clip plane.
   float tpnear;
   float nddot;
-  if (clipPlane)
+  if (t_clipPlane)
   {
     intersectPlane(ray, planeNormal, planeDist, &nddot, &tpnear);
   }

  return rgbaFloatToInt(rgba);
}

template<int bpc>
__device__ float3 gradient(const float3& pos)
{
  const float DELTA = 0.01f;

  for (int i=0; i<maxSteps; ++i)
  {
    // Test for clipping.
    const bool clippedPlane = (t_clipPlane && (((t <= tpnear) && (nddot >= 0.0f))
                                            || ((t >= tpnear) && (nddot < 0.0f))));
    const bool clippedSphere = t_useSphereAsProbe ? (t_clipSphere && ((t < tsnear) || (t > tsfar)))
                                                  : (t_clipSphere && (t >= tsnear) && (t <= tsfar));

    if (clippedPlane || clippedSphere)
    {
