Jump to content

  • Log In with Google      Sign In   
  • Create Account


Dynamic VBO vs VAO


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
3 replies to this topic

#1 challenge   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 June 2011 - 09:00 AM

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

Sponsor:

#2 apatriarca   Crossbones+   -  Reputation: 1623

Like
1Likes
Like

Posted 19 June 2011 - 09:22 AM

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?



#3 challenge   Members   -  Reputation: 100

Like
0Likes
Like

Posted 19 June 2011 - 11:20 AM

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.



#4 Danny02   Members   -  Reputation: 271

Like
0Likes
Like

Posted 19 June 2011 - 01:02 PM

1. use 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.


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).
I Think when u do this u won't need to use always the same buffer size.




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS