Sign in to follow this  

Typical number of bones in a model

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

Hi! I'm making a game, and now its time to put the bullseye soldiers ;) So, mi question is: what is the typical number of bones that have a model of Call of Duty 3, Armed Assault or any game like those? Thanks in advance

Share this post


Link to post
Share on other sites
Hi!

If you're asking this from a design standpoint (e.g. how many bones should your engine be able to handle) I really don't think you should think about that right now, as it does not affect the relevant code in any way. Just make it work and if it can't handle what you throw at it later, well, it probably wouldn't have helped much to know that in advance, you would've ended up with the same result anyway.

Share this post


Link to post
Share on other sites
Thanks for your response. I ask it because I want to use Vertex Shader 1.1 to animate models and it has very few constants (only 96) to pass in each draw call, so I need to know what is a resonable limit of bones in a human model to not to limit too much modellers.

Thanks and sorry my english, is not my mother tonge.

Share this post


Link to post
Share on other sites
Edit: More qualified posters seem to disagree with me. Pinch of salt not supplied.

It would be unreasonable for the modeller to use separate bones for fingers and toes, but not unreasonable to expect three bones per hand, two per foot and a moveable jaw.

I'd say that 25 bones is the most you should consider accommodating; 14 the fewest.

Regards
Admiral

[Edited by - TheAdmiral on November 29, 2006 12:32:53 PM]

Share this post


Link to post
Share on other sites
Quote:
Original post by Gammenon
Thanks for your response. I ask it because I want to use Vertex Shader 1.1 to animate models and it has very few constants (only 96) to pass in each draw call, so I need to know what is a resonable limit of bones in a human model to not to limit too much modellers.


That 96 constant limit is pretty low and it wont store more than 8 4x3 matrices.
On my GF6600GT the limit is 512 which gives 42 4x3 matrices, which may or may not be enough. Better cards have higher limit.

So if you wanna support these cards, you better come up with a system that breaks one mesh to multiple meshes, each using as many bones as what fits to the card: (max_uniform_components - required_data) / bone_matrix_size.
Coming up with an algorithm and implementing it for this is tedious, but possible.
And you can use quaternions and convert those to matrices in the shader, and also loose translations in the bones, that will give you more bones per draw call.

ch.

Share this post


Link to post
Share on other sites
Quote:

On my GF6600GT the limit is 512 which gives 42 4x3 matrices, which may or may not be enough. Better cards have higher limit.


Is the 512 constant registers correct? How'd you determine that?

Depending on what else you're using the registers for, you should easily get 75 or more 4x3 matrices with 256 registers.

BennyW

Share this post


Link to post
Share on other sites
You need only 3 registers per matrix. Each register is 4 floats.
So 96 registers allows theoretically 96/3 = 32 matrices.

Of course that's not practical, as you also need to use constant registers for other things like your view/projection matrix.

But it allows more matrices than you guys talk about.
I use a limit of 50 per draw primitive. When more bones are used in a model I split the model in multiple sub-meshes which never go over this limit.

To answer the original question. It depends a lot on the games. We have clients that use 70 bones per model. But we also have clients that use over 200 bones per model. They are often not all real bones that are used in skinning though. So should call them nodes instead :)

Some games model all finger bones, because they need to grab weapons correctly. Other games use just one or a few bones in the hands. It really depends on your game and the amount of detail you want.

Share this post


Link to post
Share on other sites
Quote:
That 96 constant limit is pretty low and it wont store more than 8 4x3 matrices.


As others have said, that's wrong. Each constant is a full Vector4. If you store bones as quaternion+offset, you can squeeze a modelviewprojection matrix into 4, and 46 bones into the remaining 92. Multiply vertex by quaternion is actually quite doable in a vertex shader, so you'd create the interpolated transform by linearly interpolating the quaternions, normalizing them, then multiplying the input vertex. Up to four bone weights per vertex is normal.

Quote:
use a bone matrix texture?


Hardly on a shader model 1 card, and even not all shader model 3 cards do vertex texturing (I think NVIDIA does, but ATI not).

In general, you'll have a hard time making a plausible humanoid with less than 15 bones, and for a high-quality character, I could see using ~60 bones (without counting the face!).

Share this post


Link to post
Share on other sites
doom3 uses 80-100 bones (though it does the calculations on the cpu, like me, which has benifits of no bone limits + also calcs are only done once, can be faster if u are drawing the mesh multiple times )

Share this post


Link to post
Share on other sites
From OpenGL's vertex-shader specs:
Quote:

The amount of storage
that is available for vertex shader uniform variables is specified by
the implementation dependent constant MAX_VERTEX_UNIFORM_COMPONENTS_ARB.
This value represents the number of individual floating point values, or
individual integer values or individual Boolean values that can be held
in uniform variable storage for a vertex shader

For me (GF6600GT), this value shows 512 which makes 128 vectors which makes 32 4x4 matrices or 42 4x3 matrices. Correct me if I'm still wrong, but this does read in the specs.

ch.

Share this post


Link to post
Share on other sites
Quote:
Original post by christian h

For me (GF6600GT), this value shows 512 which makes 128 vectors which makes 32 4x4 matrices or 42 4x3 matrices. Correct me if I'm still wrong, but this does read in the specs.


The value is 512, which makes 512 vectors. One register is 4 floats wide.

Bye, Thomas

Share this post


Link to post
Share on other sites
Quote:

From OpenGL's vertex-shader specs:

Quote:
The amount of storage
that is available for vertex shader uniform variables is specified by
the implementation dependent constant MAX_VERTEX_UNIFORM_COMPONENTS_ARB.
This value represents the number of individual floating point values, or
individual integer values or individual Boolean values that can be held
in uniform variable storage for a vertex shader



For me (GF6600GT), this value shows 512 which makes 128 vectors which makes 32 4x4 matrices or 42 4x3 matrices. Correct me if I'm still wrong, but this does read in the specs.

ch.


Oh I see the confusion now, some of us are talking about constant registers holding 4 values a piece, and some are talking about the number of values period.

Personally I find it easier to discuss things in terms of the vec4 registers.

Btw, I thought pixel shader 3.0 hardware was required to support a total of 256 constant registers (float, int and bool)?

BennyW

Share this post


Link to post
Share on other sites
Quote:
Original post by bennyW
Oh I see the confusion now, some of us are talking about constant registers holding 4 values a piece, and some are talking about the number of values period.

Personally I find it easier to discuss things in terms of the vec4 registers.

Btw, I thought pixel shader 3.0 hardware was required to support a total of 256 constant registers (float, int and bool)?

BennyW


Ok, I took a look with the DXCapsViewer and indeed, it shows 256 vertex shader constants, which is in float4, right?
Now I just wonder why the OpenGL implementation has half less registers? Same hardware and everything. Or are they cheating on the fact that they'd have 256 registers on DX?

ch.

Share this post


Link to post
Share on other sites

This topic is 4033 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this