fixing texture lookup in 3D instead of 2D