3D 图形批处理

发布于 2024-10-01 12:16:34 字数 134 浏览 2 评论 0原文

很多网站/文章都说“批量!”批!批!'。有人可以解释一下着色器中的“批处理”代表什么吗?

也就是说,

  1. 改变纹理
  2. 改变任意着色器变量

是否意味着某些东西不能被“批处理”?

A lot of sites/articles say 'batch! batch! batch!'. Can someone explain what 'batching' represents with respect to shaders?

Namely, does

  1. changing textures
  2. changing arbitrary shader variables

mean something can't be 'batched'?

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

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

发布评论

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

评论(2

臻嫒无言 2024-10-08 12:16:34

最简单的总结方法就是尝试尽可能少地调用 API 来绘制您需要绘制的内容。使用顶点数组或 VBO(在现代 API 中甚至不是可选的)、纹理图集以及避免状态更改的需要都有助于实现这一点。令人惊奇的是,现代 GPU 在您转身并设置下一个绘图调用的时间内可以绘制多少个三角形。

The easiest way to summarize it is to try to make as few API calls as you can to draw what you need to draw. Using vertex arrays or VBOs (not even optional in modern APIs), texture atlases and avoiding the need for state changes all contribute to that. It's really amazing how many triangles a modern GPU can draw in the time it takes you to turn around and set up the next drawing call.

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