Jump to content
  • Advertisement
Sign in to follow this  
Adaline

Input layout for skinned meshes

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

Hello

 

I define like this the input layout in cpp file :

const UINT NMF_INPUTLAYOUT_SKINNED_SIZE=8;
const D3D10_INPUT_ELEMENT_DESC NMF_INPUTLAYOUT_SKINNED[NMF_INPUTLAYOUT_SKINNED_SIZE]=
{
	{"POSITION",	0,	DXGI_FORMAT_R32G32B32_FLOAT,	0,	0,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"TANGENT",	0,	DXGI_FORMAT_R32G32B32_FLOAT,	0,	12,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"BINORMAL",	0,	DXGI_FORMAT_R32G32B32_FLOAT,	0,	24,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"NORMAL",	0,	DXGI_FORMAT_R32G32B32_FLOAT,	0,	36,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"TEXCOORD",	0,	DXGI_FORMAT_R32G32B32A32_FLOAT,	0,	48,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"TEXCOORD",	1,	DXGI_FORMAT_R32G32B32A32_FLOAT,	0,	64,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"BONES",	0,	DXGI_FORMAT_R8G8B8A8_UINT,	0,	80,	D3D10_INPUT_PER_VERTEX_DATA,	0},
	{"WEIGHTS",	0,	DXGI_FORMAT_R8G8B8A8_UNORM,	0,	84,	D3D10_INPUT_PER_VERTEX_DATA,	0}
};

... and like this in the hlsl file :

struct VS_INPUT_SKINNED
{
    float3 vPosition				: POSITION;
    float3 vTangent				: TANGENT;
    float3 vBinormal				: BINORMAL;
    float3 vNormal				: NORMAL;
    float4 vUV					: TEXCOORD0;
    float4 vUV2				        : TEXCOORD1;
    int4 ids				        : BONES;
    float4 weights				: WEIGHTS;
};

and I get this warning :

ID3D10Device::CreateInputLayout: The provided input signature expects to read an element with SemanticName/Index: 'BONES'/0 and component(s) of the type 'int32'.  However, the matching entry in the Input Layout declaration, element[6], specifies mismatched format: 'R8G8B8A8_UINT'.  This is not an error, since behavior is well defined: The element format determines what data conversion algorithm gets applied before it shows up in a shader register. Independently, the shader input signature defines how the shader will interpret the data that has been placed in its input registers, with no change in the bits stored.  It is valid for the application to reinterpret data as a different type once it is in the vertex shader, so this warning is issued just in case reinterpretation was not intended by the author. [ STATE_CREATION WARNING #391: CREATEINPUTLAYOUT_TYPE_MISMATCH]

is this normal ? If not what's wrong here ? Thanks

Edited by Tournicoti

Share this post


Link to post
Share on other sites
Advertisement

Don't worry, I just forgot I use unsigned ints for bones ids ...

changing the line :

 int4 ids				        : BONES;

into :

 uint4 ids				        : BONES;

... in the hlsl file solved the problem smile.png

 

EDIT : Thank you for your reply N.I.B, I was correcting myself at the same time ...

Edited by Tournicoti

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.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!