 #endif
 #endif
 
+#ifdef VOL3TEX3D
+            const float v = tex3D(tex_raw, float(vidx), float(c_vox[principal+1]+iPosY-line-1), float(slice));
+            const float4 c = tex1Dfetch(tex_tf, v*255.f);
+#else
 #ifdef CONSTDATA
             const float4 c = tex1Dfetch(tex_tf, ix);
 #else

#endif
   }

   // copy back or unmap for using as PBO
   ok = vvCuda::checkError(&ok, cudaGetLastError(), "start kernel");
#ifndef NODISPLAY

   cudaUnbindTexture(tex_tf);

   cudaFree(d_tf);
#ifdef VOL3TEX3D
   for(int i=0; i<3; ++i)
     cudaFree(d_voxarr[i]);
#else
#ifdef PITCHED
   for(int i=0; i<3; ++i)
       cudaFree(d_voxptr[i].ptr);
#else
   cudaFree(d_voxels);
#endif
#endif
}

