Normal Mapping - Calculating Tangent Space

Calculating Tangent Space

In order to find the perturbation in the normal the tangent space must be correctly calculated. Most often the normal is perturbed in a fragment shader after applying the model and view matrices. Typically the geometry provides a normal and tangent. The tangent is part of the tangent plane and can be transformed simply with the linear part of the matrix (the upper 3x3). However, the normal needs to be transformed by the inverse transpose. Most applications will want cotangent to match the transformed geometry (and associated uv's). So instead of enforcing the cotangent to be perpendicular to the tangent, it is generally preferable to transform the cotangent just like the tangent. Let t be tangent, b be cotangent, n be normal, M3x3 be the linear part of model matrix, and V3x3 be the linear part of the view matrix.

Read more about this topic:  Normal Mapping

Famous quotes containing the words calculating and/or space:

    I know that the right kind of leader for the Labour Party is a kind of desiccated calculating machine.
    Aneurin Bevan (1897–1960)

    As photographs give people an imaginary possession of a past that is unreal, they also help people to take possession of space in which they are insecure.
    Susan Sontag (b. 1933)