Let's talk animation

Started by
12 comments, last by BillyBillyBilly 19 years, 11 months ago
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]
Advertisement
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.
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.
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.

This topic is closed to new replies.

Advertisement