Advertisement Jump to content
Sign in to follow this  
cozzie

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

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

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

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!