 
   // Ensure that dist is big enough
   const bool infinite = (tbnear+dist != tbnear && tbfar+dist != tbfar);
+  float3 volsize = volSizeHalf * 2.0f;
 
   while(infinite)
   {

                             const float3& Lpos, const float3& V,
                             const float3& Ka, const float3& Kd, const float3& Ks,
                             const float shininess,
                             const float constAtt = 1.f, const float linearAtt = 0.f, const float quadAtt = 0.f,
                             const float3* normal = NULL)
{
  // Normal transformed from texture to volume coordinates
  float3 N = normalize(gradient<t_bpc>(texcoord));
  N = tex2vol(N);

  // Light direction


    const float3 texCoord = calcTexCoord(pos, volPos, volSizeHalf);

    const float sample = volume<t_bpc>(texCoord, volsize);

    // Post-classification transfer-function lookup.
    float4 src = tex1D(tfTexture, sample);
