PDA

View Full Version : difference between the usage of GL_TEXTURE_3D and GL_TEXTURE_2D_ARRAY​



shapeare
06-04-2012, 02:41 AM
They are the same to me?
Are they interchangeable?

kyle_
06-04-2012, 03:26 AM
Are they interchangeable?

No.

3D texture can interpolate across 'slices', texture array interpolates only inside each 'slice'.
Also, each mipmap level of 3D texture has half the 'slices' of previous level while 2D array has the same number of 'slices' across all mipmaps.

For 3D texture third coordinate is normalized while for 2D array it is not (but this rather trivial difference).

tanzanite
06-04-2012, 07:48 PM
No.
1) 3D texture can interpolate across 'slices', texture array interpolates only inside each 'slice'.
2) Also, each mipmap level of 3D texture has half the 'slices' of previous level while 2D array has the same number of 'slices' across all mipmaps. + For 3D texture third coordinate is normalized while for 2D array it is not (but this rather trivial difference).
1) No, as i found out by accident a few months ago. For example 0.5 as the third texture coordinate interpolates the 0th and 1st texture slice in the 2D_ARRAY texture. Not sure whether the behavior is by OpenGl spec (or just Nvidia interpretation of it). I did not actually need that functionality and hence did not dig it up in spec - if anyone knows, please share.
2) Yes.

aqnuep
06-04-2012, 08:58 PM
1) No, as i found out by accident a few months ago. For example 0.5 as the third texture coordinate interpolates the 0th and 1st texture slice in the 2D_ARRAY texture. Not sure whether the behavior is by OpenGl spec (or just Nvidia interpretation of it). I did not actually need that functionality and hence did not dig it up in spec - if anyone knows, please share.
2) Yes.
1) Well, that sounds like a bug in the NVIDIA drivers if it really works like that. Texel values should not interpolate between array slices.