What's up with D3DXComputeTangent()?

Started by
3 comments, last by GameDev.net 18 years, 10 months ago
I'm not sure why D3DXComputeTangent gives downright strange results when calculating the tangent and binormal (aka bitangent) basis vectors for each vertex. With a standard bump-mapped mesh with diffuse and specular lighting, and 1 point light source in the direction of the camera, this is what I got with my own ComputeTangent fn: And this is what happens when I use D3DXComputeTangent: Note the incorrect shadowing and specular highlights on the circular bumps with D3D's fn. I was wondering whether anyone else has run into this same problem with D3DXComputeTangent?
Advertisement
DirectX-specific topics should be posted in the DirectX forum [smile]. Moved.

This is kind of a wild guess, but it looks like the bumps in the second shot are inverted to being dips.

-Mezz
D3DXComputeTangent calls D3DXComputeTangentFrameEx with arguments that will never fail.

Try D3DXComputeTangentFrameEx() to get better results.
Also the WRAP_U, WRAP_V, WRAP_UV flags are VERY misleading....try it again without those flags.

This topic is closed to new replies.

Advertisement