OpenGL - 当为 VAO 设置索引缓冲区时,我可以绘制非索引吗?

发布于 2025-01-12 22:10:36 字数 176 浏览 3 评论 0原文

我设置了一个 VAO,将顶点缓冲区绑定到它以获取顶点属性,同时还设置了索引缓冲区(使用 glVertexArrayElementBuffer)。这是否会限制它,使其仅适用于 glDrawElements 类型的命令,还是也适用于 glDrawArrays ? (使用OpenGL4.5)

I set up a VAO, binding vertex-buffers to it for vertex attributes, but also set index-buffer (With glVertexArrayElementBuffer). Does that restrict it so it only works with glDrawElements type of commands, or will it work with glDrawArrays too?
(Using OpenGL4.5)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

子栖 2025-01-19 22:10:36

这是否限制它只能与 glDrawElements 类型的命令一起使用?

不,

您仍然可以使用非索引绘制调用,例如 glDrawArrays。问题是你的顶点拓扑是否适合。 glDrawArrays 本质上等于索引为 [0, 1, 2, 3, 4, 5, ...] 的索引绘制调用。

Does that restrict it so it only works with glDrawElements type of commands?

No.

You can still use non-indexed draw calls like glDrawArrays. The question is whether your vertex topology suits that. glDrawArrays is essentially equal to an indexed draw call with indices [0, 1, 2, 3, 4, 5, ...].

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文