for some reason tangent is caluculated into texcoord 1, not the actual tangent slot. so you must use texcoord1 for tangent. to generate the tangents, you need to add this flag to your material..
flags=tangent;
then to get the binormal you must do it manually in you shader code..and binormal is a *cross product* not a dot product.
if using HLSL, you do it like so:
struct VS_INPUT_STRUCT
{
float4 position: POSITION;
float3 tangent: TEXCOORD1;
float3 normal: NORMAL;
float2 texcoord0: TEXCOORD0;
};
......
binormal=cross(In.tangent, In.normal);
as a side note: this whole thing is wierd because using the compute tangent function is D3DX *should* give you the tangent in the tangent slot and the binormal in the binormal slot. At last that's what it claims to do. But in A6 the vertex format doesnt allow for this.,. why they dont change this i dont know. However, even wierder, in my dll when i have cloned a mesh to a new vertex format that should have tangent and binormal usage slots, D3DXMeshComputeTangentEX still doesnt give me the right tangent and binormal in the right slots. I actually do need ot use texcoord1 to make it work, and the binormal is never genertated correctly. Does anyone know what the deal is here?