Simply early-outing from denominators near zero was causing tangeants to be filled with garbage data. This alters the functionality to set a floor distance so the rest get's filled out properly.

This commit is contained in:
Azaezel 2013-11-13 20:40:20 -06:00
parent d5beea41c8
commit ecbcf5eb3a

View file

@ -2917,8 +2917,11 @@ inline void TSMesh::findTangent( U32 index1,
F32 denom = (s1 * t2 - s2 * t1);
if( mFabs( denom ) < 0.0001f )
return; // handle degenerate triangles from strips
{
// handle degenerate triangles from strips
if (denom<0) denom = -0.0001f;
else denom = 0.0001f;
}
F32 r = 1.0f / denom;
Point3F sdir( (t2 * x1 - t1 * x2) * r,