gpt4 book ai didi

webgl - WebGL 的 MAX_TEXTURE_SIZE 是最大面积、直径还是字节数?

转载 作者:行者123 更新时间:2023-12-01 22:25:50 37 4
gpt4 key购买 nike

有趣的是,有多少文档避免了对 WebGLRenderingContext#getParameter(WebGLRenderingContext.MAX_TEXTURE_SIZE) 含义的歧义。 “大小”不是很具体。

它是以字节为单位的纹理的最大存储大小,意味着降低位深度或使用更少的颜色 channel 会增加最大尺寸?它是纹理的最大直径(以像素为单位),这意味着如果您的纹理是高度矩形的,则您在可寻址区域方面会受到更多限制?它是最大像素数吗?

最佳答案

正如它在 WebGL spec section 1.1 中所说的那样

The remaining sections of this document are intended to be read in conjunction with the OpenGL ES 2.0 specification (2.0.25 at the time of this writing, available from the Khronos OpenGL ES API Registry). Unless otherwise specified, the behavior of each method is defined by the OpenGL ES 2.0 specification

OpenGL ES 2.0.25 spec, section 3.7.1

The maximum allowable width and height of a two-dimensional texture image must be at least 2^(k−lod) for image arrays of level zero through k, where k is the log base 2 of MAX_TEXTURE_SIZE and lod is the level-of-detail of the image array.

这是您可以为纹理指定的最大宽度和/或高度。请注意,正如@Strilanc 指出的那样,这与内存无关。因此,虽然您可以创建 1 x MAX_TEXTURE_SIZEMAX_TEXTURE_SIZE x 1 纹理,但您可能无法创建 MAX_TEXTURE_SIZE x MAX_TEXTURE_SIZE 纹理d 内存不足

关于webgl - WebGL 的 MAX_TEXTURE_SIZE 是最大面积、直径还是字节数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34946523/

37 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com