opengl vbo建议 [英] opengl vbo advice

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

问题描述

我有一个在Blender中设计的模型,该模型将在将其导出到collada之后使用opengl构建的游戏引擎中进行渲染.搅拌器中的模型分为几组.这些组包含具有自己索引的顶点法线和纹理.如果我将每个组呈现为单独的vbo是很好的事情,还是应该将整个模型呈现为单个vbo?

I have a model designed in Blender that i am going to render, in my game engine built using opengl, after exporting it to collada. The model in blender is divided into groups. These groups contains vertices normals and textures with there own index. is it a good thing to do if i rendered each group as a separate vbo or should i render the whole model as a single vbo?

推荐答案

经验法则是:

  • 总是尽可能少地改变OpenGL状态; <​​/li>
  • 总是尽可能少地与OpenGL对话.
  • always do as few OpenGL state changes as possible;
  • always talk to OpenGL as little as possible.

主要原因是与GPU进行对话的成本很高.如果给它一些东西,GPU会更快乐,这需要花费很长时间才能完成,然后在工作时再也不打扰它.因此,除非有一个VBO,否则它可能会导致更好的解决方案,除非它会导致您需要使用的存储量大幅度增加,并因此而无法在其他地方进行缓存.

The main reason being that talking to the GPU is costly. The GPU is much happier if you give it something it'll take a long time to do and then don't bother it again while it's working. So it's likely that a single VBO would be a better solution, unless it would lead to a substantial increase in the amount of storage you need to use and hence run against caching elsewhere.

这篇关于opengl vbo建议的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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