• Advertisement
Sign in to follow this  

writing to vbo each frame

This topic is 4619 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I've used vbo's before for terrains - so I create them once and reference to data with them. Is there any difference for when I write to them each frame - ie when using them for animation and so each triangle will be in a different position ? Do I have to set them up any differently ? I read something in the vbo spec about MAP/UNMAp - is this relevant to what I plan to do and if so when do I map/unmap as it seems unclear to me what to do. cheers Adrian

Share this post


Link to post
Share on other sites
Advertisement
map/unmap is probably not the best way to go, depending on how you are doing your animation.

If you are just copying data from another memory location into the VBO then glBufferSubData() is probably going to be the best way todo it. Combine this with getting the driver to release the old VBO and allocate a new one because you dont need the data (do by using glBufferData() with 'null' as the source address) and you should be golden.

However, if you are generating your triangles on the fly a map/unmap might be faster as you can map the location and directly write to it from your generation algo. instead of using an intermediate buffer, which reduces the amount of memory copying work however could result in other stalls.

Try both, see which works for you [smile]

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement