If the triangle is either not mapped or degenerate, the geometric edges are used to compute the tangent. If the triangle is mapped (that is, has uv's) and those uvs are non-degenerate then the computation in Per triangle tangent computation) is performed.ĭegenerate uv's means having a 0 length vector in uv space along any edge of the triangle. The normals used are the geometric normals which consider smoothing and user normals.įor each triangle on a face the tangents for each vertex of the triangle are computed. The tangent computation is based on the texture coordinates (uv) of a given texture coordinate set (uvset) used. $tangentArray -= $n * $tangentArray.dot( n) $crossP = crossProduct( $edge1, $edge2 ) $crossP = crossProduct( $edge1, $edge2 ) ĭegnerateUVTangentPlane = equivalent( $crossP, 0.0f ) $crossP = crossProduct( $edge1, $edge2 ) īool $degnerateUVTangentPlane = equivalent( $crossP, 0.0f ) $edge1 = $t - $t // s-vector - don't need to compute this multiple times S & T vectors get used several times in this vector, Outputs: For each vertex we compute and return a tangent vector (3-float) : tangentArray Inputs: For each vertex of a triangle we pass in: v (vertex position, 3-float), n (normal position, 3-float) t (tex coord value, 2 float) : v, n t
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |