问题描述
如果我理解正确,如果我将 TEXTURE_MIN_FILTER
设置为 NEAREST
那么 sampler2DArray
/TEXTURE_2D_ARRAY 和
sampler3D
/TEXTURE_3D
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
差异似乎是
GenerateMipmap
会将交叉层与 3D 纹理混合,但不会混合 2D 数组- 在 GLSL 中传递给
texture
的Z
坐标对于 3D 纹理是 0 到 1,但在 2D 数组中是 0 到 N(深度). - 如果过滤不是 NEAREST 3D 将跨层混合,2D 阵列不会.
GenerateMipmap
will blend cross layers with 3D textures but not 2D arrays- the
Z
coordinate passed totexture
in GLSL is 0 to 1 with 3D textures but an 0 to N (depth) in 2D arrays. - If filtering is not NEAREST 3D will blend across layers, 2D array will not.
正确吗?
推荐答案
不正确.还有一个区别:mipmap 大小.
Incorrect. There's one more difference: mipmap sizes.
在 3D 纹理中,宽度、高度和深度都随着 mipmap 尺寸的减小而减小.在二维数组纹理中,每个 mipmap 级别具有相同 数量的数组层;只有宽度和高度减少.
In a 3D texture, the width, height, and depth all decrease at lower mipmap sizes. In a 2D array texture, every mipmap level has the same number of array layers; only width and height decrease.
这不仅仅是混合和一些纹理坐标奇怪的问题;纹理数据的大小是不同的.它是一种非常不同的种类纹理,不同于 3D 纹理,就像 2D 纹理与 1D 纹理一样.
It's not just a matter of blending and some texture coordinate oddities; the very size of the texture data is different. It is very much a different kind of texture, as different from 3D textures as 2D textures are from 1D textures.
这也是您无法创建 3D 纹理的视图纹理的原因一个二维数组,反之亦然.
This is also why you cannot create a view texture of a 3D texture that is a 2D array, or vice-versa.
这篇关于了解 2D 纹理数组和 3D 纹理之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!