• Advertisement
Sign in to follow this  

Num bones influence per vertex

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

I want to stay away from D3DX animation "module" so i am trying to write plugin for 3ds max to export skinned mesh to my own format.

I dumped some info  into text file to see how many bones is each vertex influenced:

 

...
VERT[19] BCNT: 1
    BINX: 32 Weight: 1.000000
VERT[20] BCNT: 1
    BINX: 32 Weight: 1.000000
VERT[21] BCNT: 1
    BINX: 32 Weight: 1.000000
VERT[22] BCNT: 1
    BINX: 32 Weight: 1.000000
VERT[23] BCNT: 1
    BINX: 32 Weight: 1.000000
VERT[24] BCNT: 2
    BINX: 31 Weight: 0.337000
    BINX: 32 Weight: 0.663000
VERT[25] BCNT: 2
    BINX: 31 Weight: 0.330000
    BINX: 32 Weight: 0.670000
VERT[26] BCNT: 2
    BINX: 31 Weight: 0.371000
    BINX: 32 Weight: 0.629000
...

 

Some vertex have influence by 1, some by 2 and some by 3 bones.

This is the problem since in HLSL shader i need to know how many bones have influence to correctly transform my vertex.

 

What is the common way for this?

 

Should i add another vertex element to be able to tell?

Something like:

D3DVERTEXELEMENT9 vertexElements[] =
    {
        { 0, 0,  D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_POSITION,     0 },
        { 0, 12, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_NORMAL,       0 },
        { 0, 24, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,     0 },
        { 0, 32, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT,      0 },
        { 0, 44, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL,     0 },
        { 0, 56, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 },
        { 0, 60, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT,  0 },
        { 0, 76, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD,     1 }, // put number of influence here
        D3DDECL_END()
    };

 

Thank you for your time.

 

 

Share this post


Link to post
Share on other sites
Advertisement
Sign in to follow this  

  • Advertisement