0
\$\begingroup\$

firstly you need to now i am beginner :)

i am using opengl and for display vertex buffer object(vbo).

i made 2000 frames animation model with blender and i export with (.obj) files and i upload all these 2000 obj files to my opengl project.

But upload process is taking too much time. like 7-8min and this method use too much vram around 2-3gb.

Despite all this i'm glad draw performance because when i draw 100 animation(same model) at the same time my pc using %1-2 cpu and %70-80gpu.

Now i want to learn is there another method of good draw performance and low system consumption ? (i want to draw 100 and much more animation model at the same time)

\$\endgroup\$
  • 1
    \$\begingroup\$ Can you give us an example of what kinds of changes you're animating from frame to frame? Depending on how the object needs to change, we'll use different techniques, including skinned skeletal animation, morph targets/blend shapes, or vertex shader animations and other runtime procedural approaches. \$\endgroup\$ – DMGregory Sep 4 '18 at 18:12
  • \$\begingroup\$ i uploaded my animation youtu.be/rNssO3vck_s i want 100-150 draw this animation model in the same time. like mmorpg games. example glDrawArrays(GL_TRIANGLES,0,anim55.frame); ..... glDrawArrays(GL_TRIANGLES,0,anim600.frame); ..... glDrawArrays(GL_TRIANGLES,0,anim1555.frame); ..... \$\endgroup\$ – Emre Kaya Sep 5 '18 at 5:13
1
\$\begingroup\$

What you're showing looks like it can be accomplished with conventional "skeletal' or "skinned mesh" animation.

To do this, we do not export a completely separate model file for every animation frame, analogous to rendering out individual sprites of a spritesheet animation.

Instead, our outputs are:

  • the vertex positions/normals/etc & triangle indices for the model in a single pose, often called a "bind pose" or "T-pose."

  • a hierarchy of bones corresponding to this pose. Each bone has a local position & orientation and a parent, establishing the structure of the moving parts.

  • skinning weights for each vertex, identifying a set of bones that influence that vertex's position, and how much effect each of those bones should have.

  • animation data, in the form of position & orientation keyframes for each bone.

When we want to show a particular frame of the animation in-game, we transform the bone hierarchy according to the skeletal animation for that frame, then transform each vertex position/normal according to the skinning weights that link it to those bones. The model is reshaped into a new pose on the fly.

Because we store the animation of just the bones, not every vertex, we get a massive savings in the amount of data that needs to be stored, and we can continue re-using the same triangle mesh for every frame.

We can even re-use this same animation data for other models that use the same bone skeleton but different triangle mesh & skinning data, or to animate swappable equipment & attachments on characters so it follows their movements without each piece needing its own custom animations.

We get further data savings by storing just the keyframes rather than every frame of the sequence. When displaying a frame that lands between two keyframes, their poses can be interpolated at runtime, allowing us to play animations at different speeds, or even blend & layer multiple animations.

These animation sampling and skinning calculations can be performed very efficiently, even offloaded to the GPU, so you can still render a large number of animated models despite more calculations happening at runtime.

I hope this clarifies the high-level strategy. As I'm not an animator or animation programmer myself, I'll have to defer to other answers to provide more specific direction in how to export skeletal animation data from the particular tools you're using, and how to implement sampling, skinning, & rendering the animation in-game.

You should find lots of existing resources to get you started if you search for the terms laid out above. This is probably the most common way to do animations in 3D games, so there are lots of guides.

\$\endgroup\$
  • \$\begingroup\$ many thanks you for your attention. i will learn skelatal animation technic and i will apply my project after i compare it with my old way. again thank you too much. \$\endgroup\$ – Emre Kaya Sep 5 '18 at 8:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.