Vertex Buffer and game entities

Started by
1 comment, last by skwee 13 years, 9 months ago
Hello!

I'm doing some sort of high level abstraction for my game.
As I understood the common convention is to have so called game entities, which are simply objects in the scene (either renderable or not like triggers).
Now assuming I create a renderable entity with geometry, texture, material and etc. To render it I have to create vertex buffer for it and then bound the vertex buffer to the device (I'm talking here about DirectX9, but since it a general game question and not dx related i ask it in this forum).
Now I can have very large number of entities, should every renderable entity be created with its own vertex buffer? Should I reuse the vertex buffers somehow?

Sorry for stupid (maybe?) question and thanks a lot for help!

I would love to change the world, but they won’t give me the source code.

Advertisement
Lots of your game entities are probably going to share the same models, so I would make the VB belong to the model, and then make GameEntities share models.
GameEntity points to a Model.Model points to a Vertex buffer.
Ya thats sounds a lot better! Thanks for this!

I would love to change the world, but they won’t give me the source code.

This topic is closed to new replies.

Advertisement