fixed deallocation in Texture2D and added Texture3D