 		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)				

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

			lightGetDiffusePower()
		);

		cudaUnbindTexture( tDiffuse );
		cudaUnbindTexture( tIllum );
		cudaUnbindTexture( tSpec );
		cudaUnbindTexture( tNormal );
	}
	cudaUnbindTexture( tDepthBuffer );
}


