 
     float3 texCoord = calcTexCoord(pos, volSizeHalf);
 
-    const float sample = volume(texCoord/* + randOffset*/);
+    const float sample = volume<bpc>(texCoord);
 
     // Post-classification transfer-function lookup.
     float4 src;


  glClear(GL_COLOR_BUFFER_BIT);
  glBegin(GL_QUADS);
    glTexCoord2f(0.0, 0.0); glVertex3f(-1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 0.0); glVertex3f(1.0, -1.0, 0.5);
    glTexCoord2f(1.0, 1.0); glVertex3f(1.0, 1.0, 0.5);
    glTexCoord2f(0.0, 1.0); glVertex3f(-1.0, 1.0, 0.5);
  glEnd();

  glMatrixMode(GL_PROJECTION);

  const float3 H = normalize(L + V);

  // Clip sphere.
  const float3 center = make_float3(_renderState._roiPos[0],
                                    _renderState._roiPos[1],
                                    _renderState._roiPos[2]);//make_float3(0.0f, 128.0f, 128.0f);
  const float radius = _renderState._roiSize[0] * vd->getSize()[0];//150;

  // Clip plane.
  const float3 pnormal = normalize(make_float3(0.0f, 0.71f, 0.63f));
  const float pdist = 0.0f;

  if (vd->bpc == 1)
  {
      render<
             true, // Front to back.
             1, // Bytes per channel.
             0, // Mip mode.
             true, // Local illumination.
             true, // Opacity correction.
             false, // Jittering.
             false, // Clip sphere.
             false // Clip plane.
            ><<<gridSize, blockSize>>>(d_output, width, height,
                                       diagonalVoxels / (float)numSlices,
                                       volSize * 0.5f,
                                       L, H,
                                       center, radius * radius,
                                       pnormal, pdist);
  }
  else if (vd->bpc == 2)
  {
      render<
             true, // Front to back.
             2, // Bytes per channel.
             0, // Mip mode.
             true, // Local illumination.
             true, // Opacity correction.
             false, // Jittering.
             false, // Clip sphere.
             false // Clip plane.
            ><<<gridSize, blockSize>>>(d_output, width, height,
                                       diagonalVoxels / (float)numSlices,
                                       volSize * 0.5f,
                                       L, H,
                                       center, radius * radius,
                                       pnormal, pdist);
  }
  cudaGLUnmapBufferObject(_pbo);

  glBindBuffer(GL_PIXEL_UNPACK_BUFFER_ARB, _pbo);
  glBindTexture(GL_TEXTURE_2D, _gltex);
