Currently, the tangent calculation can produce NaN results when vertices are too close to each other. This causes rendering issues in Unity 2021 with HDRP.
The root cause seems to be that we normalize a zero length vector when calculating an angle between vertices. We then multiply the NaN result to a zero tangent vector. Since the intention is to return a zero tangent and bitangent when the area between vertices is to small, I do that more directly and return early.
Results of the fix
Currently, the tangent calculation can produce NaN results when vertices are too close to each other. This causes rendering issues in Unity 2021 with HDRP.
The root cause seems to be that we normalize a zero length vector when calculating an angle between vertices. We then multiply the NaN result to a zero tangent vector. Since the intention is to return a zero tangent and bitangent when the area between vertices is to small, I do that more directly and return early. Results of the fix