3D图形配料图形

2023-09-08 00:56:31 作者:摆摆舞!

很多网站/文章说批!批量!批量!'。有人能解释配料重presents相对于着色器?

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

也就是说,确实

在不断变化的纹理 在改变任意着色器变量

的意思是不能被批?

(很抱歉,如果这是一个弱智的问题:D)

(Sorry if this is a retarded question :D)

推荐答案

要总结一下就是尽量让尽可能少的API调用,你可以画出你所需要绘制的最简单方法。使用顶点数组或维也纳组织(即使是在现代的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.

 
精彩推荐
图片推荐