gpt4 book ai didi

opengl - 关于 GL_VERTEX_ARRAY 的一个问题

转载 作者:行者123 更新时间:2023-12-01 11:05:16 24 4
gpt4 key购买 nike

这只是出于兴趣,但是 GL_VERTEX_ARRAY 将“保持”并通过 drawArrays() 之类的东西渲染的顶点数量是否有限制?或者理论上我可以通过几百万个顶点并且仍然能够调用 drawArrays() 吗?

最佳答案

自 OpenGL-1.2 以来,在使用 glDrawRangeElements 时存在一种限制:

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling GetIntegerv with the symbolic constants MAX_ELEMENTS_VERTICES and MAX_ELEMENTS_INDICES. If end-start+1 is greater than the value of MAX_ELEMENTS_VERTICES, or if count is greater than the value of MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices in the range start; end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be achieved with an optimal index set.

但这更像是一个建议,而不是一个硬性约束。除此之外,真正的限制是安装的内存量,以及为索引元素数组选择的类型可以解决的问题

但是,glDrawRangeElements 的限制通常也可以很好地指示一般的批量大小。

关于opengl - 关于 GL_VERTEX_ARRAY 的一个问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6475418/

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