I'm making a 3D first person game. Should I give each character its own VBO or should I batch all characters into a single VBO? What are the pros/cons?
|
|
This is really a choice between performance and flexibility, but I'll list my opinions about it. One single VBO The positive sides are:
and the negative sides are:
Individual VBO:s The positive sides are:
and the negative sides are:
Summary I'd recommend you to profile your application; get your real bottleneck in data you can see. Premature optimization can be shown (in this case) as unnecessary. However, that being said, if you'd discover a real performance loss in your application, given the individual VBO:s scenario, you can start implementing a single VBO. However, as long as it's not needed (the number of objects are low, not many state changes overall, etc) I'd recommend to go with individual VBO:s unless you see that's not gonna work. Edit I forgot to mention that it'd be alright with multiple draw calls. The most important thing in performance critical times is to keep the state changes at a minimum. You can simply set the number of indices to process and an offset for every draw call, and this is fine. But however, keep state changes as low as possible and make as few draw calls as possible, that's the big hello of this answer, or at least what I tried to say. |
|||||||||
|