多少个顶点缓冲区就太多了?
较新的 API(例如 D3D11)强制使用顶点缓冲区。
您可以使用 静态(内容不变)或动态顶点缓冲区(内容可以由CPU更新和改变)。
我的问题是,多少个顶点缓冲区才算太多?你怎么知道你正在接近极限? 每个模型都应该有自己的顶点缓冲区吗?您是否应该只拥有诸如 8 个顶点缓冲区之类的东西并在所有模型之间共享它们,并根据需要进行更新?
Newer API's like D3D11 force use of vertex buffers.
You can use static (contents don't change) or dynamic vertex buffers (contents can be updated and changed by CPU).
My question is, how many vertex buffers is too many? How do you know you are approaching the limit? Should every model have its own vertex buffer? Should you only have something like, say 8, vertex buffers and share them between all models, updating as necessary?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
你不应该为每个对象都有一个新的顶点缓冲区,不。但是,你将需要为每个纹理一个新的顶点缓冲区。你会想要尽可能多地填满它们。而且8个也不算太多!
you should not have a new vertex buffer for every object, no.. However you will need one for every texture. And you're going to want to fill them up with as much as you can. Also 8 is not too much!
您不需要为每个纹理使用不同的 vb。您可以使用偏移到缓冲区中的附加参数来绘制子集,并从该缓冲区中绘制给定数量的顶点。在对drawindexedprimitive的任何后续调用之间设置纹理。
You don't need a different vb for every texture. You can draw subsets using additional arguments that offset into a buffer, and draw a given number of vertices from that buffer. Set texture between any subsequent calls to drawindexedprimitive.