How should I manage my VAOs and VBOs?
I'm sure you've heard this question a lot, and I've read thoughts on other forums but I haven't found anything in my search here.
My question is, how should I separate objects among different VAOs and VBOs?
In learning how to use OpenGL, I have been working on modeling objects in 3DS Max, exporting them into the COLLADA format, and I am now working on rendering them in my OpenGL application.
If I have an object such as a car which is made of different parts that are their own geometries in the exported COLLADA file, how should I distribute them into VAOs and VBOs?
Should I make a VAO for each part? (The body, each door, each wheel, etc..) And a VBO for each part?
Should I put all the vertex data into one big VBO? Then use only one VAO?
Should I use only one VAO and then a VBO for each part?
In essence, what is best practice in organizing the separate parts of an object and then in organizing a collection of objects? (multiple cars?!)
Thanks for your help! =)
My 2 cents. If you're not going to use NV bindless on the VBOs, use one big VBO and stream the data to the GPU with it and use display lists for the static stuff. Binding VBOs is expensive, so you want to minimize the amount of that you end up doing.
I'll let someone else take the VAOs question. Bindless gets you that speed-up and more.
Tags for this Thread