Archived

This topic is now archived and is closed to further replies.

VBOs and animation

This topic is 5132 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

When using vertex buffer objects with a mesh that is animating (keyframe, skeletal, ...), what is a good way to send the current state of vertices to the pipeline? Should I store the initial mesh position in a VBO, get the vertices from the GPU memory each frame, interpolate, and then re-store in another VBO, or should I just stick to system memory for animating meshes, or something else? I''m sure there are several approaches to it. What do you think is the most efficient?

Share this post


Link to post
Share on other sites
Keep a copy in system memory, and as you generate your new vertices, store them in a tempoarary VBO. Doing this a good time before the buffer is rendered may also help with perfromance here. Or, alternativly, storing the animated mesh in a system memory buffer and using another thread to copy it into a vbo... Then rendering it later in the frame... Don''t, though, read from a VBO buffer, it''s very very slow thing to do, and you will see your performance plumit even compared to not using VBOs.

Temp VBOs if used right are a lot faster than standard vertex arrays if you do them right. It''s all about keeping the CPU and GPU running full tilt the entire time. When one has to wait for the other, thats when things blow up performance wise (eg, if the cpu must wait for a memory copy to the GPU).

as an alternative, you could always consider vertex-shader/blending based animation.. this skips this entirly

blah.

| - Project-X - On hold (kindof ).. - | - adDeath - | - my windows XP theme - | - email me - |

Share this post


Link to post
Share on other sites
All of what RipTorn said is full of wisdom, except maybe the vertex shader thingy that could be discussed but it''s a bit off-topic.

I just wanted to add that your animated mesh may update vertex positions and normals every frame, but generally colors and texture coords don''t change every frame, so it''s a good thing to have two separates VBOs : one for dynamic data (vertex, normal) and one for static data (color, texcoord). If you merge them all in a single VBO, when you update vertex coords and normals then the driver may upload all (vertex+normal+texcoord+color) data even though only vertex and normal need to be uploaded. Hope I''m clear enough

Share this post


Link to post
Share on other sites