VBO

Started by
1 comment, last by dbzprogrammer 18 years, 4 months ago
I just read the NeHe tutorial on VBO's. And now I'm quite happy with the speed difference! Especially with a 256 MB video card. My quesiton is, once you load the data to the video card, is there a way I can modify it? Say I load a basic character in, but need to animate him with skeletal animation. Would I just have to rotate it and then upload it into a VBO, or could I just modify the array on the VRAM? One last thing, when you bind and load textures to OpenGL, are they saved on the video card? Thanks in advance.
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"
Advertisement
Depending on your target hardware you might be better off doing the skeletal animation in a vertex shader, saves the CPU work.

However, if thats not an option then, no, you cant modifiy the data in VRAM. You dont have direct access to it (nor can you get it). The fastest method is to maintain a copy of the model in system ram and modify it there and upload it to the VBO when you've animated it (glBufferSubData() being the function you need iirc).

For faster uploading you'll want to invalidate the old buffer first, this is done by calling glBufferData() (again, iirc) with a NULL or 0 as the data address field BEFORE you upload your new data. This basically tells the driver "I'm done with the current content of the buffer, just lose it when you are done with it" (works for both NV and ATI).
Ok, so here's what I got from you. The fastest way would be to put the animation on the vertex shader. Then copy the whole sceen's verticies to the VBO and render it... Sounds good! =D
We should do this the Microsoft way: "WAHOOOO!!! IT COMPILES! SHIP IT!"

This topic is closed to new replies.

Advertisement