writing to vbo each frame

Started by
1 comment, last by _the_phantom_ 18 years, 7 months ago
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
Advertisement
Yes. Look here for more details.
- Iliak -
[ ArcEngine: An open source .Net gaming framework ]
[ Dungeon Eye: An open source remake of Eye of the Beholder II ]
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]

This topic is closed to new replies.

Advertisement