2D Texture Array vs. 3D Texture

They have no similarities at all. At least, conceptually speaking. A 2D array texture is a 2D texture where each mipmap level contains an array of 2D images. A 3D texture is a texture where each mipmap level contains a single three-dimensional image.

The purpose of a 2D array texture is to be able to have multiple 2D textures in a single object. That way, the shader itself can select which image to use for each particular object. Texture coordinates mean the same thing as 2D textures: representing a location in 2D space. It’s just that you also have a selector that says which 2D image in the array to use.

3D textures are all about sampling from within a volume of data. That is, you have texture coordinates which are three-dimensional in nature, perhaps representing a position within the texture’s volumetric space.

The two texture types do not contend with one another. That is, there’s no problem that you could solve with a 2D array texture that could also be solved with a 3D texture (or at least, not without having to dodge some form of visual artifact). And vice-versa; if you need a 3D texture, it’s in a problem space where a 2D array texture would not be appropriate.

Oh sure, internally in the hardware, they are mostly just a few differences between them. Specifically, lower mipmaps of arrays have the same depth but different widths and heights, and filtering for arrays is always nearest for the Z component. But as far as OpenGL itself (and the use of either texture type) is concerned, they’re two different things which solve two completely distinct sets of problems.

So there should never be a case where you’re trying to select between one or the other.