现代GPU的纹理变化(以及其他状态变化)费用 [英] Texture change (and other state-change) costs on modern GPUs

查看:189
本文介绍了现代GPU的纹理变化(以及其他状态变化)费用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在写一个场景图的图形引擎建模的目的。我使用XNA 4。 在许多地方,我一直在读,纹理变化(和其他国家的变化)应该在渲染过程中最小化(所以我要为了我的原语用材料等)。

I'm writing a scene-graph based graphics engine for modeling purposes. I'm using XNA 4. On many places I have been reading, that texture changes (and other state changes) should be minimized during rendering (so I have to order my primitives by materials, etc.).

我创建了XNA 4小测试应用程序,这是使数百斯坦福兔子模型单一的质感,然后做同样的切换2种不同的纹理。有渲染时间(不过,我使用的小〜100×100的纹理)没有什么区别。

I created a small test application in XNA 4, which was rendering hundreds of stanford bunny models with a single texture, then doing the same toggling 2 different textures. There was no difference in rendering time (however I used small ~100x100 textures).

所以,我的问题是:

  • 如果我真的很在乎用质地/色彩/其他材料参数排序我的原语?或者是它在现代GPU不那么重要?
  • 什么是业绩亏损的可预期的百分比,如果我不?
  • 是否还有其他的状态变化,这可能影响性能?
  • 在哪里可以找到一些最新的文献/最佳实践指南样?

感谢您的帮助,或联系!

Thank you for any help or links!

推荐答案

状态的变化还没有真正昂贵的的的时间。 批次是昂贵的。(和状态的变化就必须了新一批)。一批基本上是调用一个绘图*基元的功能。

State changes haven't really been expensive for a long time. Batches are expensive. (And a state change necessitates a new batch). A batch is basically a call to a Draw*Primitives function.

<一个href="http://origin-developer.nvidia.com/docs/IO/8230/BatchBatchBatch.pdf?q=docs/IO/8230/BatchBatchBatch.pdf">This来自NVIDIA的PDF 解释得很详细。这也给了想法,减少批次计数。

This PDF from nVidia explains it in detail. It also gives ideas for reducing your batch count.

批次是基于CPU的限制(而不是GPU)。这PDF列表&LT; 130三/批为呈交批占主导地位的性能点和GPU闲置等待更多批次(的详细信息)。它还说,你得到约400批次的每帧,在60 FPS,每个CPU供电专用于提交批次1GHz的。 (尽管PDF是有点老了,所以这些数字都有点过时了。)

Batches are a CPU-based limit (not GPU). That PDF lists "< 130 tris/batch" as the point where submitting batches dominates performance and the GPU sits idle waiting for more batches (details). It also says you get about 400 batches per frame, at 60 FPS, per 1GHz of CPU power dedicated to submitting batches. (Although the PDF is a bit old, so those figures are a bit out of date.)

我的<一个href="http://gamedev.stackexchange.com/questions/8521/the-practical-cost-of-swapping-effects/8533#8533">answer在gamedev网站一个类似的问题应该提供一些更多的细节。 这其中也

My answer on the gamedev site to a similar question should provide some more details. This one too.

这篇关于现代GPU的纹理变化(以及其他状态变化)费用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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