       const float shininess = 1000.0f;
       if (justClippedPlane)
       {
-        src = phong(src, texCoord, L, H, Ka, Kd, Ks, shininess, &planeNormal);
+        src = phong<bpc>(src, texCoord, L, H, Ka, Kd, Ks, shininess, &planeNormal);
         justClippedPlane = false;
       }
       else if (justClippedSphere)
       {
         float3 sphereNormal = normalize(pos - sphereCenter);
-        src = phong(src, texCoord, L, H, Ka, Kd, Ks, shininess, &sphereNormal);
+        src = phong<bpc>(src, texCoord, L, H, Ka, Kd, Ks, shininess, &sphereNormal);
         justClippedSphere = false;
       }
       else
       {
-        src = phong(src, texCoord, L, H, Ka, Kd, Ks, shininess);
+        src = phong<bpc>(src, texCoord, L, H, Ka, Kd, Ks, shininess);
       }
     }
     justClippedPlane = false;

using std::cerr;
using std::endl;

texture<uchar, 3, cudaReadModeNormalizedFloat> volTexture;
texture<float4, 1, cudaReadModeElementType> tfTexture;
texture<float4, 1, cudaReadModeElementType> randTexture;


__global__ void render(uint *d_output, const uint width, const uint height, const float dist,
                       const float3 volSizeHalf, const float3 L, const float3 H,
                       const float3 sphereCenter, const float sphereRadius,
                       const float3 planeNormal, const float planeDist)
{
  const int maxSteps = INT_MAX;
  const float tstep = dist;
