If I understand correctly, if I was to set TEXTURE_MIN_FILTER
to NEAREST
then there's not much difference between sampler2DArray
/TEXTURE_2D_ARRAY
and sampler3D
/TEXTURE_3D
The differences seem to be
GenerateMipmap
will blend cross layers with 3D textures but not 2D arraysZ
coordinate passed to texture
in GLSL is 0 to 1 with 3D textures but an 0 to N (depth) in 2D arrays.Correct?
Apart from the answer already given, there is another difference worth noting: The size limits are also quite different. A single layer of an array texture may be as big as an standard 2D texture, and there is an extra limit on the number of layers, while for 3D textures, there is a limit constraining the maximum size in all dimensions.
For example, OpenGL 4.5 guarantees the following minimal values:
GL_MAX_TEXTURE_SIZE 16384
GL_MAX_ARRAY_TEXTURE_LAYERS 2048
GL_MAX_3D_TEXTURE_SIZE 2048
So a 16384 x 16384 x 16 array texture is fine (and should also fit into memory for every GL 4.5 capable GPU found in the real world), while a 3D texture of the same dimensions would be unsupported on most of todays implementations (even though the complete mipmap pyramid would consume less memory in the 3D texture case).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With