When one gets the tangent/binormal vectors they are almost always, in practice, not going to be perpendicular to the normal because the mesh will be smoothed.
Is this a problem? Can one simply use the tangent basis as is, or does one need to orthonormalize the basis?
I tried both ways and I could always see individual triangles in my mesh at some angles if I tried to do per pixel lighting with a flat normal map while if I did regular per vertex lighting my mesh was smooth looking.
Is it possible to get smooth tangents like you can get smooth normals?
I started a thread about that recently but I can’t find it right now.
This may be redundant, but to clarify a little on Jan’s link:
You can create your tangent space vectors in a ‘smooth’ fashion. Basically, from each triangle in the mesh, you can derive one tangent space by use of the triangle edges and the triangle’s vertices’ texture coordinates.
What you need is, however, one tangent space per vertex. The previous paragraph means, that you can have an unlimited number of tangent spaces per vertex (one for each triangle that shares the vert you’re looking at). To get a smooth tangent space appearance, add the tangent, binormal and normal of all of those tangent spaces up for each vertex, and normalize in the end. This will deliver tangent space vectors that vary smoothly from vertex to vertex.
Originally posted by Dodger:
To get a smooth tangent space appearance, add the tangent, binormal and normal of all of those tangent spaces up for each vertex, and normalize in the end. This will deliver tangent space vectors that vary smoothly from vertex to vertex.
What do you do when you get to a vertex which is smoothed by multiple faces, but all the UVs (and therefore tangents) are unrelated? You can’t add them up because that makes no sense, but you can’t leave them either or you’ll have a noticable seam.
How do you smooth unrelated tangents that have a smooth normal?
[This message has been edited by titan (edited 01-08-2004).]