Original Post
After loading a mesh with D3DXLoadMeshFromX(), I use CloneMesh() to duplicate it, with a tangent, binormal and normal included in the submitted D3DVERTEXELEMENT9-array. Then I make this call: D3DXComputeTangentFrameEx(pMesh, D3DDECLUSAGE_TEXCOORD, 0, D3DDECLUSAGE_TANGENT, 0, D3DDECLUSAGE_BINORMAL, 0, D3DDECLUSAGE_NORMAL, 0, D3DXTANGENT_GENERATE_IN_PLACE, (DWORD*)pAdjacency->GetBufferPointer(), 0.01f, 0.25f, 0.01f, NULL, NULL) But with certain objects, D3DX complains about vertices have to be split, and therefore won't fit in the mesh to be generated in. How do I get the amount of resulting vertices of this operation, so that I can create a fitting mesh? Is there any other workaround to this problem? I have experimented with the threshold-parameters passed to the function, but it doesn't seem to help.