• Advertisement

Archived

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

Let's talk animation

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

Hey, I''m trying to decide how to do animation. Idealy I''d like to do skeletal, but the arb_vertex_blend isn''t a very common extension for people to have (and it''s a pain not having programs immediately work on computers). There''s also arb_vertex_program which seems to be possessed more frequently. Anyway, what kind of animation do you guys use and stuff? Any information you could dump would be great. Thanks for reading, -billy

Share this post


Link to post
Share on other sites
Advertisement
I use keyframe animation. Uses more memory, and you have less freedom, but it''s faster and works on any GPU.
What are you trying to do? Many games (space, RTS, TBS, etc.) won''t require bone animation.

Share this post


Link to post
Share on other sites
I am doing an RPG and I''m trying to do something like the Warcraft III engine (if you''ve played that). So I don''t need extremely detailed character models or animations.

How does keyframe work? I could just make a bunch of display lists for each frame. That would be easy and very fast. Do you interpolate between the different keyframes? I don''t know how that''d work, without re-sending vertex data each frame, which would be slow...

hrm. *ponders*

Share this post


Link to post
Share on other sites
with keyframing you do interpolate between the two frames either side of the current time in the animation to get your current location.
I dont see how this would be 'slow' as you have to resend the vertex data every frame anyways and the speed hit you'll suffer is probably quite minor if you use something like VAs.
If you are using VBOs then you could use a vertex program to do the work, however keep in mind that for non-hardware vertex shader cards this will be a sub-optimal route if you try to force the vertex data into VRAM, you'd be better off with keeping them as VAs even if you used vertex programs.



[Phantom Web | OpenGL Window Framework]
"i wonder why i do that... type words which are nuffin like the word i wanted every now and badger"


[edited by - _the_phantom_ on May 9, 2004 12:12:21 AM]

Share this post


Link to post
Share on other sites
The only problem with keyframe animation is that they eat a LOT of memory, if you use it as a VA or VBO (to maximize the performance). I use MD2s and I don''t even use interpolation.

Share this post


Link to post
Share on other sites
I was hoping I could just stick each frame in a separate display list. That way it''s in the graphics memory hopefully and I can just call the needed list based on the current frame. But that wouldn''t be very smooth compared to keyframe, I supose.

Share this post


Link to post
Share on other sites
Don''t do that, it takes too much memory.
Instead, use vertex arrays (or just plain begin/end, if your models are too big)

Share this post


Link to post
Share on other sites
ack, you DO NOT want to use glbegin/glend if you want even slighly sane performance with more than a couple of polys on the screen, hand feeding the gfx card is a waste of time and resources, fine for knocking up small things and the odd test I guess but really.. no.

Share this post


Link to post
Share on other sites
_the_phantom_, it depends. If you have like 30 models, with 600 polys each, 200 frames/model, then the memory use can get insane, so sometimes begin/end is prefered.
In my engine, it is user configurable if the drawing is done the VA or begin/end way.

Share this post


Link to post
Share on other sites
I''d actually be very interested to know what model format Warcraft3 models are in. From playing the game, it seems to incorporate: Alphablend/alphakey textures, keyframed animation a la md2, ''hot spots'' (for things like spell action points, and feet for footprints), billboards (for instance gnolls'' whacky things, or the spheres on the Arcane Sanctum), particle systems (some characters emit smoke/steam/bilious green gas).

I''m guessing it''s a warcraft-specific format with a 3ds max exporter. Which segues nicely into another query - how do you make a multi-animation md2 model in, say, gmax? Like most other editors, gmax seems to have no intrinsic support for multiple animations in a single file (although I haven''t tried Milkshape, which I guess would do that).

Skeletal animation is good for ragdoll effects. If you''re not gonna do them, then it''s too much work.

Share this post


Link to post
Share on other sites
quote:
Original post by Raduprv
_the_phantom_, it depends. If you have like 30 models, with 600 polys each, 200 frames/model, then the memory use can get insane, so sometimes begin/end is prefered.
In my engine, it is user configurable if the drawing is done the VA or begin/end way.


it all has to go in memory somewhere, be that in a glbegin/end pair or in data, infact i'd argue that putting in an array would be SMALLER than doing the glbegin/end pair as (a) you can pack the data together and overlap and (b) dont have all the redundant code for drawing laying around which takes up more space in ram.
but, hey, if you want to waste ram thats upto you

btw, with your example you are already eatting betwen 216Meg (worse case, raw triangles with no duplicate vertices) and 72meg (best case, perfect tri-strip with no duplicate vertices) of ram with just your model data, never mind any level data or anything, which is why unless you have a VERY small animation set, you shouldnt go for storing each frame and instead should use key framing or skeleton animation...


[Phantom Web | OpenGL Window Framework ]
"i wonder why i do that... type words which are nuffin like the word i wanted every now and badger"


[edited by - _the_phantom_ on May 10, 2004 2:27:14 AM]

Share this post


Link to post
Share on other sites
No, that''s not true. If you keep the faces and UV the same for every frame, you will need to modify only the vertices list, which takes considerably less memory.

Share this post


Link to post
Share on other sites
ah yes, having reworked it out (btw, this is without normals, i forgot them in my inital maths) it comes to between 130Meg and 44Meg, which isnt so bad (although that is only xyz and uv). I assumed the data would be interleaved for max speed instead of spread around
Either way, my point about wastage and slowness via the glbegin/end and the fact that the data has to go somewhere still stands.

Share this post


Link to post
Share on other sites
Well, in our engine we use MD2s (but we convert them to our format on the fly, after they are loaded). Using begin/end it takes about 60 MB (whole game, not only animations), and with them ''unpacked'' to have them in VAs it takes more than double. We want our game to work even on computers with 128 RAM, so that''s why we have two ways of rendering them.
Besides, unless there are a lot of players/monsters on the screen , there is not much of a difference. The only difference is when there are more than 10.
BTW, everything else (the static stuff) is rendered using VA.

Share this post


Link to post
Share on other sites

  • Advertisement