Jump to content
  • Advertisement
Sign in to follow this  

HLSL Skinning X models

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

In the skinnedmesh SDK sample there is a comment that you can't use CloneMesh() (the stream declarator version) because it does something with the blend indices. The SDK sample uses CloneMeshFVF() instead and manually changes a semantics flag in the vertex declaration. I chose the CloneMesh() approach and after spending 2 hours, I almost got the model right (connected properly) but it is still slightly distorted. The neck stretches a little and so does the arm in animation. Rendering in fixed function mode works fine, so I believe the problem has something to do with the blend weights or blend indices. I would appreciate if anyone can shed some light on this. My vertices are non-FVF because I want to use normal mapping, so I'm not sure how I could use CloneMeshFVF() for this. Here's my vertex layout: float3 position, normal,tangent,binormal, float2 uv float4 blendweight,blendindices

Share this post

Link to post
Share on other sites
The indices are always packed in one DWORD. In your shader they will come in as int4.

BTW, I am cloning the mesh after the ConvertToIndexedBlendedMesh call to put it in the order I want. I am not having any problems with this messing up the bone data in the vertex buffer.

I want it like this for a skinned mesh with a max of 3 bone influences (like the Tiny_4anim.x file):

struct vertex
D3DXVECTOR3 normal;
float weights[2];
DWORD Indices;

Then the header for my vertex shader is:

OutputTexVS VS( float3 posL : POSITION0,
float3 normalL : NORMAL0,
float2 tex0: TEXCOORD0,
float2 weights : BLENDWEIGHT0,
int4 boneIndex : BLENDINDICES0)

[Edited by - DXnut on March 14, 2006 2:41:19 AM]

Share this post

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

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!