Dynamic VBO vs VAO

Started by
2 comments, last by Danny02 12 years, 10 months ago
Hello everybody!

I have a dynamic VBO and I need to change all content and also the size EVERY FRAME. In order to rebuild VBO I have to build an vertex array with all data. Is VBO better over VAO only because it's using video card memory, or does it have other advantages? I'm asking this because I also can use that VAO instead of VBO so I don't need to transfer data to video card. I have made some tests with my particle engine (where now I use a VAO to send points to the shader) but no clear result, I get around 18 fps with both VAO/VBO when sending lots of points.
What is the best solution? VBOs for static stuff and VAO for dynamic or is there another way?

Thank you in advice and sorry for my english
Advertisement
First of all, VAO is probably not what you are thinking about (look here). It's VA (vertex arrays) without the O.

What do you mean by changing the size of the buffer every frame? What you should do is using a fixed size VBO (the maximum size you want to support) and then only use a part of it (sending the data with glBufferSubData). How do you create the VBO? Are you using the correct GL_STREAM_DRAW usage flag?


First of all, VAO is probably not what you are thinking about (look here). It's VA (vertex arrays) without the O.

Sorry, I misunderstood what VAO means, I wanted to say Vertex Array.


What do you mean by changing the size of the buffer every frame? What you should do is using a fixed size VBO (the maximum size you want to support) and then only use a part of it (sending the data with glBufferSubData). How do you create the VBO? Are you using the correct GL_STREAM_DRAW usage flag?

No, I dont use GL_STREAM_DRAW, instead I use GL_DYNAMIC_DRAW, however it works as it is supposed to. Thank you anyway, I didn't thinked about the fixed size VBO.

[font="arial, verdana, tahoma, sans-serif"] [/font][font="arial, verdana, tahoma, sans-serif"] [/font]
1. use [color="#1c2837"]stream instead of dynamic, these flags are only optimization flags for the driver so it will work with any flag, but u can get better performance when u choose the right one.
[color="#1c2837"]

[color="#1c2837"]2. best use first glBufferData with "null" as data and the glSubBuffer for uploading(this is faster then using only subBuffer cause the driver don'T have to wait until all draw calls to the old data has finished)[color=#1C2837][size=2].
[color=#1C2837][size=2] I Think when u do this u won't need to use always the same buffer size.

This topic is closed to new replies.

Advertisement