what is the maximum number of bones per vertex?

The place for artists, modellers, level designers et al to discuss their approaches for creating content for OGRE.
Post Reply
User avatar
bugshake
Greenskin
Posts: 111
Joined: Sat Feb 26, 2005 1:12 pm
Location: Amsterdam
Contact:

what is the maximum number of bones per vertex?

Post by bugshake »

when skinning, in 3dsmax, you assign bones to vertices in varying weights.

I noticed with my model, hardware skinning produces strange behaviour. Specificly, vertices not participating in the movement of certain bones anymore.

i'm assuming this is because of a hardware maximum

my question is: what is this maximum? and if it depends on the hardware, what is a reasonable amount? 2? 4?

thanks
User avatar
walaber
OGRE Expert User
OGRE Expert User
Posts: 829
Joined: Sat Oct 02, 2004 2:20 pm
Location: California, USA
Contact:

Post by walaber »

the maximum is 4 bones per vertex.
Go Go Gadget OGRE!!
Image
User avatar
sinbad
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 19269
Joined: Sun Oct 06, 2002 11:19 pm
Location: Guernsey, Channel Islands
x 67
Contact:

Post by sinbad »

If it's hardware skinning that's not working, it's the max number of bones, not the bones per vertex. vs_1_1 only has enough constant space for about 24 bones, if your skeleton has more you'll have to use vs_2_0 or split up the skeleton.
User avatar
bugshake
Greenskin
Posts: 111
Joined: Sat Feb 26, 2005 1:12 pm
Location: Amsterdam
Contact:

Post by bugshake »

4 bones per vertex? I've got a max of three but I'm also blending animations, so maybe then it can get higher?

I didn't know about the 24 bones limit, thanks. i've got 23 however, so that's not the problem.

thanks for the answers, I'm doing a new model at this moment with max 2 bones/vertex, if it turns out I have the same problem there, I'll upload this model.

BTW, i'm using the exact same material as Examples/Robot, but with a different texture

edit: :oops: just realized this shader is called 'HardwareSkinningOneWeight' which might be an indication ;) so I guess I might need to make and use a 'HardwareSkinningTwoWeights' script... right?
User avatar
:wumpus:
OGRE Retired Team Member
OGRE Retired Team Member
Posts: 3067
Joined: Tue Feb 10, 2004 12:53 pm
Location: The Netherlands
x 1

Post by :wumpus: »

Or just use the fourweights one.
User avatar
bugshake
Greenskin
Posts: 111
Joined: Sat Feb 26, 2005 1:12 pm
Location: Amsterdam
Contact:

Post by bugshake »

How do I use the fourweights one? I tried simply replacing the name of the shader:

Code: Select all

vertex_program_ref Ogre/HardwareSkinningFourWeights
{
	param_named_auto worldMatrix3x4Array[0] world_matrix_array_3x4
	param_named_auto viewProjectionMatrix viewproj_matrix
	param_named_auto lightPos[0] light_position 0
	param_named_auto lightPos[1] light_position 1
	param_named_auto lightDiffuseColour[0] light_diffuse_colour 0
	param_named_auto lightDiffuseColour[1] light_diffuse_colour 1
	param_named_auto ambient ambient_light_colour
}
but then i get a different problem. I think the other glitch is gone now, but I get 2 new strange yet rather funny things:
- the first position of the animation is blent in 50% all the time... (in this case the position is the character crouching to start a jump, with this 50% blent in, it seems he walks like a really old guy)
- the fog distance is different (closer) for the character, so when far away, the character appears as a fog-colored silouette in not-quite-so-foggy surroundings

I tried removing the "shadow_caster_vertex_program_ref HardwareSkinningOneWeightShadowCaster" bit, but with no effect.

I would really appreciate if you have more clues
Post Reply