 		for (int i = 0; i < 9; ++i)
 		{
 			index2 = min(max(startIndex + curIndex, 0), frameWidth * frameHeight);
-			if ((depth = tex1Dfetch(_depthBuffer, index2)) < minDepth)
+			if ((depth = tex1Dfetch(tDepthBuffer, index2)) < minDepth)
 			{		
 				vd = voxelBuffer[index2];				
 				if (fabsf(vd.pos.x - .5f - x) <= vd.pos.z)			

	cudaBindTexture
	(
		(size_t *) 0,
		_depthBuffer,
		(void *) thrust::raw_pointer_cast( m_depthBuffer.data() ),
		_depthBufferDesc,
		(size_t) ( resolution() * sizeof( unsigned int ) )
	);
	if( shadowPass )

	m_voxelBuffer.resize( resolution() );
	m_shadowMap.resize( resolution() );

	tDiffuse.normalized = true;
	tDiffuse.filterMode = cudaFilterModeLinear;
	tDiffuse.addressMode[0] = tDiffuse.addressMode[1] = cudaAddressModeWrap;

	tIllum.normalized = true;
	tIllum.filterMode = cudaFilterModeLinear;
	tIllum.addressMode[0] = tIllum.addressMode[1] = cudaAddressModeWrap;

	tSpec.normalized = true;
	tSpec.filterMode = cudaFilterModeLinear;
	tSpec.addressMode[0] = tSpec.addressMode[1] = cudaAddressModeWrap;

	tNormal.normalized = true;
	tNormal.filterMode = cudaFilterModeLinear;
	tNormal.addressMode[0] = tNormal.addressMode[1] = cudaAddressModeWrap;
}


