Kivy + 3D - 只允许 65535 个索引。我能处理这个吗?

Kivy + 3D - only 65535 indicies allowed. Can i handle this?

根据documentation,索引缓冲区中只能有65535个索引。这对于今天的 3d 图形来说确实是明智而痛苦的限制。所以,我的问题是 - 是否有可能以某种方式处理这个问题?例如,更改源代码中的某些内容?这是 真的 OpenGL ES 2.0 限制吗?

这个问题实际上有一个不好的解决方案 - 拆分绘制调用,并为 3d 模型中的每 65535 个顶点分别设置顶点和索引缓冲区,但这确实是一个性能问题,因为一些顶点需要在拆分缓冲区的不同部分之间复制。

我将非常感谢有人向我解释我在哪里可以找到这部分 kivy 代码并更改它,或者解释为什么我不能更改它,如果我真的不能。

根据

OpenGL ES Common Profile Specification Version 2.0.25 (Full Specification) (November 2, 2010)

指数必须

be one of UNSIGNED_BYTE or UNSIGNED_SHORT, indicating that the values in indices are indices of GL type ubyte or ushort, respectively.

所以,只要 Kivy 在使用 OpenGL 2,我认为你就受限于这个限制。

在 OpenGL 3.3 中,该限制是索引:

must be one of UNSIGNED_BYTE, UNSIGNED_SHORT, or UNSIGNED_INT, indicating that the index values are of GL type ubyte, ushort, or uint respectively.

如果您的 GL ES 实现支持 OES_element_index_uint 扩展,您可以自由使用 GL_UNSIGNED_INT 作为索引。

I will be really grateful to someone who will explain me where can i find this part of kivy code and change it

除其他答案外,没有什么能真正从根本上将 Kivy 限制为 OpenGL ES 2,因此如果您愿意,使用新版本的功能可能并不难。但是,您可能找不到简单地给您差异的人。您需要查看 Kivy graphics code 并可能扩展 opengl cython 包装器。