Sign in to follow this  
Walking_Target

OpenGL Vertex Buffer Performance in Keyframe Animation

Recommended Posts

I'm just starting to learn a little about Vertex Buffers in OpenGL. As I understand, a Vertex Buffer Object is something that lets you store vertex data in Server(VRAM) memory rather than Client(RAM) memory. This improves performance over vertex arrays because the data doesn't have to be moved to the video card each time you render. This makes sense for static models. For models with keyframe animation though, the position of vertices is tweened to give a smooth animation. So at first I imagined maybe we store the keyframes in VBO and see an improvement. But, we still have to perform the calculations and then render the tweened vertices, which aren't stored in a VBO, using the old fashion glFloat3v() method. On the other hand, we could throw the tweened vertices into a VBO every update, which means we'd allocate memory once, move data many times. Then we're still performing the memory transfer by hand but never having to hunt for space again. I guess I'm just asking if someone can explain the best way to render keyframe animations in OpenGL using VBOs, and maybe why it's the best way. ...maybe I've figured it out in the process of writing the post?

Share this post


Link to post
Share on other sites
Another option is to use a vertex shader to animation your model. Just pass the matrices in and bone weights and have it do the transformations (:

Share this post


Link to post
Share on other sites
Yeah exactly

although a counter argument to vertex shaders would be if you were already GPU bound. If your GPU is already doing so much work that your CPU is sitting around waiting for it most of the time, your better off doing this work on CPU. (:

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this