Original Post
🔒 Locked
Tangent Vector
Advertisement
Generally, the tangent vectors of the vertices of a triangle aren't the same. Think about the way per-vertex normals are generated. Each per-vertex normal is the sum and normalization of the normals of the triangles it is a part of. The same is true of tangent vectors, with one difference: you can't generate a per-triangle tangent vector, because a tangent vector can be different for each vertex of a triangle (this is dependent on the texture coords).
I generally use this code (with modifications) to generate my tangents: http://www.terathon.com/code/tangent.php
btw, I don't bother storing the binormal/bitangent; I create it with lBinormal = cross( IN.mNormal, IN.mTangent ) in my vertex programs.
I generally use this code (with modifications) to generate my tangents: http://www.terathon.com/code/tangent.php
btw, I don't bother storing the binormal/bitangent; I create it with lBinormal = cross( IN.mNormal, IN.mTangent ) in my vertex programs.
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement