3D 图形批处理 [英] 3D Graphics Batching

查看:34
本文介绍了3D 图形批处理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很多网站/文章都说批量!批!批!'.有人可以解释一下批处理"在着色器方面的含义吗?

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

也就是说,确实

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

意思是不能批量处理"?

mean something can't be 'batched'?

推荐答案

总结它的最简单方法是尝试尽可能少地调用 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.

这篇关于3D 图形批处理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆