   Vertex format in the .x file
  I want to write a shader program to display a model. But I found that I can't know what exactly the vertex format is in a .x file. Althought there is a function GetFVF but I can't know what kind of combination it is.Could anyone share some information? Thanks a lot in advance!   
  You can work out the vertex structure from the FVF. E.g. if the FVF is D3DFVF_XYZ | D3DFVF_TEX1, then you know there's a position (3 floats) and one set of texture coordinates (2 floats). And since you know the order the components have to be in (It's documented in the SDK help somewhere), you can work out the vertex structure.   ;  The best thing to do is to clone the mesh into the format your shader expects.  That way you can load the various .x files that come with the SDK and render them.  For some, you will need to have DX create the normals.  Here is how I check the .x file for normals and texture coordinates:D3DVERTEXELEMENT9 elems[MAX_FVF_DECL_SIZE];BOOL hasNormals = FALSE;BOOL hasTexCoords = FALSE;hr = ObjectMesh->GetDeclaration(elems);if (SUCCEEDED(hr)){for(int i = 0; i < MAX_FVF_DECL_SIZE; ++i){// Did we reach D3DDECL_END() {0xFF,0,D3DDECLTYPE_UNUSED, 0,0,0}?if(elems.Stream == 0xff)break;if( elems.Type == D3DDECLTYPE_FLOAT3 &&elems.Usage == D3DDECLUSAGE_NORMAL &&elems.UsageIndex == 0 ){hasNormals = TRUE;}if( elems.Type == D3DDECLTYPE_FLOAT2 &&elems.Usage == D3DDECLUSAGE_TEXCOORD &&elems.UsageIndex == 0 ){hasTexCoords = TRUE;}}}