Jump to content

View more

Image of the Day

#ld38 #screenshotsaturday Mimosa Fizz action gif #2 https://t.co/TUzdppvfUL
IOTD | Top Screenshots

The latest, straight to your Inbox.

Subscribe to GameDev.net Direct to receive the latest updates and exclusive content.


Sign up now

Dynamic VBO vs VAO

4: Adsense

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   

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

#2 apatriarca   Members   

2355
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   

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   

279
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.