   Directx Sample ParallaxOcclusionMap Wrong Tangent  Issue
  Hi, i was looking the normal maps on my game, and i notice what the lightreflects wrong on the objects by 45 degrees, was a lot of thinking, i triedto flip the tangent, the binormal, and the light was always wrong, then ilook very very close and finally notice the 45 degree error......As i thought, the tangent generation was the problem, and that was very freaky because i made the generation just like the Parallax Occlusion Mapsample of directx, how that can be wrong!?, they use:D3DXComputeTangentFrameEx( pMesh, D3DDECLUSAGE_TEXCOORD,  0, D3DDECLUSAGE_TANGENT, 0,  D3DDECLUSAGE_BINORMAL, 0,  D3DDECLUSAGE_NORMAL, 0, 0,   rgdwAdjacency,  -1.01f,-0.01f,-1.01f, &pNewMesh, NULL );And for my skinned meshes (they work fine, no 45 degree error) i use:D3DXComputeTangent( pMesh, 0, 0, 0, TRUE, NULL);So, i changed the function an whalla! fixed!  My need to know wtf washappening drive me to the sample itself, and the sample has the sameerror on normal map, the parallax works well, BUT when i chanche thefunction D3DXComputeTangentFrameEx by D3DXComputeTangent on the samplethe normal map works well, but the parallax goes wrong!See:http://img41.imageshack.us/img41/3874/now.pngLeft: D3DXComputeTangentFrameExRight: D3DXComputeTangentAs far i can see, on the left the lighting is wrong because the directionof the light not correspond with the specular reflect, on the right theself shadow are right, i mind left low corner of every dent are shadowed right.Know, my question is why? why the Parallax works well, in that case whythey left the normal map wrong!On my Engine when the tangent was wrong:http://img132.imageshack.us/img132/2532/wrongjaja.pngNow With D3DXComputeTangent:http://img132.imageshack.us/img132/3267/goodu.pngThanks![Edited by - _Camus_ on May 22, 2009 1:00:40 AM]