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:

    [The] elderly and timid single gentleman in Paris ... never drove down the Champs Elysees without expecting an accident, and commonly witnessing one; or found himself in the neighborhood of an official without calculating the chances of a bomb. So long as the rates of progress held good, these bombs would double in force and number every ten years.
    Henry Brooks Adams (1838–1918)

    The peculiarity of sculpture is that it creates a three-dimensional object in space. Painting may strive to give on a two-dimensional plane, the illusion of space, but it is space itself as a perceived quantity that becomes the peculiar concern of the sculptor. We may say that for the painter space is a luxury; for the sculptor it is a necessity.
    Sir Herbert Read (1893–1968)