gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > MDL & Skeletal animation

#71017 - ishraam - Fri Feb 10, 2006 12:44 am

Hello,

I am thinking about using a Half Life MDL format for some homebrew. The nice thing about it is that it :
- has skeletal animation (where Quake MDL format had not)
- includes hitboxes (nice for fight, collision,...)
- has been created for low polys
Correct me if I m wrong.

So here are 3 questions :
- pros and cons for skeletal anim on DS ? (nice for data size is smaller, but won't it cause too much work on the CPUs ?)
- Any other 3D file format (with skeletal anim) that feets well in a DS ?
- Anyone know where I can find HL MDL file format reference ?
>I have found sources, but I don't wanna waste time guessing what's what.

I know a MDL file is a compression of a .QC file (describing the content of the MDL), and .SMD files (containing either the bind pose - aka "reference" -, or animations). I can read both SMD & QC files, since they are text files, but I do not know how thery are compiled to a single binary MDL.

Help of any sort will be much appreciated! ^_^

#71034 - tepples - Fri Feb 10, 2006 1:33 am

ishraam wrote:
I know a MDL file is a compression of a .QC file (describing the content of the MDL), and .SMD files (containing either the bind pose - aka "reference" -, or animations). I can read both SMD & QC files, since they are text files

I thought .smd was interleaved ROMs for Sega Genesis.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#71042 - ishraam - Fri Feb 10, 2006 1:50 am

:)
http://developer.valvesoftware.com/wiki/SMD_file_format

#71043 - ecurtz - Fri Feb 10, 2006 2:08 am

Skeletal animation is the way to go on the DS. You'll want to consider exporting into a more native structure for the data rather than keeping it in .mdl format though.

The bone matrices (up to 32 iirc) can be pushed onto the matrix stack at the beginning of rendering and there is essentially no further CPU overhead for the bones. Take a look at the registers for the 3D stuff that involve the matrix stack. Essentially any of those calls can be compiled inline into the display list for your model. Then you just calculate the bone positions, push those onto the matrix stack and then dump the whole display list onto the 3D hardware.

#71052 - ishraam - Fri Feb 10, 2006 3:46 am

@ ecurtz : Thanks for the answer.

New fresh questions off the top of my head :) :

1. "more native structure": did you mean something precise ? are you refering to the "my_dingdong_thing.bin" files that can be found in examples ?

2. "32 iirc" ... what's "iirc" ? (I think I know about "32" :p)

3. DS has no hardware for quaternions, which are usually used in skeletal animation (well that's not only the DS...). So when you say "Push onto the matrix stack", I guess there MUST be CPU overhead (providing I'm using quaternions). No ?

4. Finally, display list should be used for static stuff (that's the case for traditionnal OpenGL), for example a building with no animation. So I don't think they should be used for animations (be it skeletal, or else). Yet I think I saw them being used in a MD2 rendering call... Could you briefly explain me where I'm wrong ??

[EDIT : Forget the Q3 remark about quaternion... -_- ]

#71084 - ecurtz - Fri Feb 10, 2006 7:13 am

ishraam wrote:
@ ecurtz : Thanks for the answer.

New fresh questions off the top of my head :) :

1. "more native structure": did you mean something precise ? are you refering to the "my_dingdong_thing.bin" files that can be found in examples ?

2. "32 iirc" ... what's "iirc" ? (I think I know about "32" :p)

3. DS has no hardware for quaternions, which are usually used in skeletal animation (well that's not only the DS...). So when you say "Push onto the matrix stack", I guess there MUST be CPU overhead (providing I'm using quaternions). No ?

4. Finally, display list should be used for static stuff (that's the case for traditionnal OpenGL), for example a building with no animation. So I don't think they should be used for animations (be it skeletal, or else). Yet I think I saw them being used in a MD2 rendering call... Could you briefly explain me where I'm wrong ??


1. By more native I mean display lists, or at least a version of the .mdl with all of the values pre converted to fixed point and scaled correctly. These would usually be included as .bin files and shown using glCallList() - textures and other stuff are often included as binary data as well, so it's not necessarily 3D data in the demos.

2. Sorry, iirc == If I Recall Correctly

3. Yes, you'll have to do the quaternion math yourself. I have some untested 3D math methods, including quaternion stuff if you want them.

4. The DS display list can include commands such as swapping textures or changing the transform matrix within the list along with the geometry. Assuming you only have one bone per vertex you can define the entire model. At that point animation consists solely of setting the bone matrices to the right values prior to submitting the list.

#71194 - acox - Fri Feb 10, 2006 10:53 pm

Quote:
4. The DS display list can include commands such as swapping textures or changing the transform matrix within the list along with the geometry. Assuming you only have one bone per vertex you can define the entire model. At that point animation consists solely of setting the bone matrices to the right values prior to submitting the list.


Interesting!

Which leads me to two questions:


    1) Does the DS have hardware support for (multiple bones + weights per vert)-type skinning? (your post implies not)]

    2)Is the HL MDL format limited to one bone per vert ?

_________________
3D on GBA

#71215 - ecurtz - Sat Feb 11, 2006 2:12 am

acox wrote:

1) Does the DS have hardware support for (multiple bones + weights per vert)-type skinning? (your post implies not)]


I'm not sure, but probably no.

acox wrote:

2)Is the HL MDL format limited to one bone per vert ?


I'm not positive, but I think yes (for HL 1).

Was that vague enough? Obviously I don't know the definitive answer to either of those, but I'm pretty confident about both replies.