Original Post
Hopefully I`ll get some answers here ;) I have a typical mesh with Position, Normal and Texture coordinates... I have code that goes like this: In my shader i have: I checked with shader debugger and I get all values for Tangent and Binormal = (0,0,0); Other values (position, normal, tex) are ok... I tried with different objects too... What am I doing wrong? No errors with maximum validation...
Mesh original = Mesh.FromFile(...)
VertexElement[] decl = original.Declaration;
decl[3] = new VertexElement(0, 32, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.Tangent, 0);
decl[4] = new VertexElement(0, 44, DeclarationType.Float3,
DeclarationMethod.Default, DeclarationUsage.BiNormal, 0);
decl[5] = VertexElement.VertexDeclarationEnd;
bumpMappedMesh = original.Clone(MeshFlags.Managed, decl, original.Device );
bumpMappedMesh.ComputeTangent(0, 0, 0, 0);
VS_OUTPUT VS( float4 Pos : POSITION, float3 Norm : NORMAL, float2 Tex :
TEXCOORD0, float3 Tangent : TANGENT0, float3 Binormal : BINORMAL0 )
{
VS_OUTPUT Out = (VS_OUTPUT)0;
....