How to fix d3dx debug warning? (declaration / fvf)

Started by
1 comment, last by cozzie 10 years, 2 months ago

Hi,

I've recently started using 'd3dx9d' when in debug mode, and noticed the following warning during debugging:


D3DX: ID3DXMesh::GetFVF:  The declaration cannot be converted to an FVF

After some debugging I found out the warning is generated several times during the execution of loading an X mesh, this is the line of code:


	if(FAILED(D3DXLoadMeshFromXA(pXfilename.c_str(), 
								 D3DXMESH_MANAGED, //SYSTEMMEM, // DYNAMIC??? SYSTEMMEM FOR DYNAMIC OBJECTS??
								 mD3ddev,
								 &mAdjacencyBuffer,
								 &mMaterialBuffer,
								 NULL,
								 &mSubMeshSize,
								 &mMesh))) return false;

Do you have any idea what could case these annoying warnings?

As far as I am aware of I don't use FVF's anywhere in my code/ engine, everything I do uses vertex declarations.

It seems to happen only when my X file mesh that's loaded, already has binormals and tangents.

For X file meshes that don't have them yet, I calculate them using d3dxcomputetangentframeex.

The vertex declaration I use throughout the whole engine does include binormals and tangents:


typedef struct TVERTEX
{ 
	D3DXVECTOR3	position;
	D3DXVECTOR3	normal;
	float    	tex[2];	
	D3DXVECTOR3 binormal;
	D3DXVECTOR3 tangent;
} TVERTEX;

const D3DVERTEXELEMENT9 vtxdecl[] =
{
	{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_BINORMAL, 0},
	{0, 44, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TANGENT, 0},
	D3DDECL_END()
};

Any ideas?

Ps.; the end result is fine by the way, just want to understand/ remove the warnings

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

Advertisement

Apparently the internal workings of dx9 call the mesh function GetFVF. From the docs for ID3DXBaseMesh::GetFVF:

This method can return 0 if the vertex format cannot be mapped directly to an FVF code. This will occur for a mesh created from a vertex declaration that doesn't have the same order and elements supported by the FVF codes.

There aren't FVF codes for, e.g., binormals. You can ignore the warning. You can also set the Warning level in the dx control panel.

Please don't PM me with questions. Post them in the forums for everyone's benefit, and I can embarrass myself publicly.

You don't forget how to play when you grow old; you grow old when you forget how to play.

Thanks, that clears things up because indeed binormals and tangents dont have fvf variants.
I'll ignore them for now, turning down debug level might cause missing other warnings.

Crealysm game & engine development: http://www.crealysm.com

Looking for a passionate, disciplined and structured producer? PM me

This topic is closed to new replies.

Advertisement