Here's my suggestion. (I haven't tried this, but it oughtta work...) 1. Transform PerPixelNormal into the same space as your tangent vectors. (if they aren't in the same space already) 2. Define PerPixelTangent as the cross product of Bitangent and PerPixelNormal. 3. Normalize PerPixelTangent. 4. If the dot product of…
Here's another possibility. Slightly more expensive, but might be better looking. You may want to try both and see which works best. 1. Transform PerPixelNormal into the same space as your tangent vectors. (if it's not in the same space already) 2. Define PerPixelBitangent as the cross product of Tangent and…