Why a normal map needs a frame
A geometric triangle has a plane normal, but a material may have small ridges whose lighting changes over the triangle. A tangent-space normal map stores a direction at each texture location. Its three components are coordinates in a local frame, not a world-space direction: the same stored value can point in different world directions on different parts of a curved object. The map changes the normal used by a shading model; it does not by itself displace the surface, change the silhouette, or introduce geometric occlusion.
Definition 3.5.1
(Triangle edges and the UV determinant)
We first build a frame for a single nondegenerate triangle. All vectors below are in one Euclidean coordinate system. Let its positions be and texture coordinates be . Write , , and . The UV determinant is . A nonzero says the three UV coordinates span an area; a nondegenerate geometric triangle separately requires . Neither condition implies the other.
Deriving the parameter directions
Inside the triangle let and . If , the affine position as a function of UV has partial derivatives satisfying
Theorem 3.5.2
(Triangle UV derivatives)
If , the unique derivatives consistent with the affine position and UV maps are
If also , these two derivatives are linearly independent and span the geometric tangent plane.
Proof
(Eliminating one parameter direction)
Multiplying the first equation by and subtracting times the second gives ; the other formula follows by eliminating . Invertibility of the UV matrix makes the solution unique. Moreover,
so geometric nondegeneracy and make this cross product nonzero. Thus the derivatives form a basis for the same plane as the edges. The sign of reverses their oriented cross product when the UV chart is mirrored.
Proof X-ray
Two independent tests
measures area in the texture domain; measures geometric area. The inverse UV matrix constructs parameter derivatives, while the cross product establishes whether those derivatives span a plane. A very small nonzero permits the algebra but makes the calculation sensitive to UV perturbations; exact invertibility is not a numerical stability guarantee.
Worked example 3.5.3
(A scaled texture chart)
Take , , and UV coordinates . Here , and . These are derivatives per unit of texture coordinate, not unit vectors. Increasing by one moves only half a world unit on this affine extension. The normalized axes are and .
From derivatives to an orthonormal shading frame
Definition 3.5.4
(Orthonormal shading frame)
Let be the chosen unit shading normal. It may be an interpolated vertex normal rather than the geometric plane normal. Project the derivative into the plane perpendicular to and normalize:
This requires . Set , with either or . The sign records the frame's handedness.
Proposition 3.5.5
(The shading frame is orthonormal)
Let be a unit vector and in the construction above. Then are mutually perpendicular unit vectors for either sign . Consequently, for decoded , .
Proof
(Projection leaves a unit tangent perpendicular to the normal)
Because , , so the unit vector is perpendicular to . For perpendicular unit vectors, is perpendicular to both and has length ; multiplying by keeps these properties. So are orthonormal, and by the Pythagorean theorem .
When is the oriented geometric normal, a natural convention is , provided the dot product is nonzero. If an interpolated shading normal is used, that sign also requires a nonzero dot product. Otherwise the construction must report a degenerate frame or use an explicitly documented fallback; silently normalizing zero does not define one.
Common mistake
(Taking the bitangent to be the normalized v-derivative)
The original need not be perpendicular. The orthonormal frame retains the direction of the projected and the orientation sign, but it does not retain the full UV scale and shear. This is a convention for interpreting the map, not an equality . For example, , and give and (here ), whereas is not even perpendicular to .
Map baking and rendering must use compatible frames, interpolation, handedness and seam conventions; different legitimate choices can make a visible seam. Mirrored UV islands often need different signs, so a mesh may need separate vertex records at a seam even when the positions coincide.
Worked example 3.5.6
(A mirrored chart)
Let the geometric normal be , and . Then and , so and . The tangent-space direction therefore means world direction . Ignoring the sign would point this direction the other way.
Decoding and transforming a sample
For the common convention in which three stored linear channels encode components by , compute . Other asset conventions may reverse an axis or use a different encoding; choose them explicitly.
Common mistake
(Decoding a normal map as sRGB color)
The channels are directional data, not colors to be decoded with an sRGB color transfer function. Such a decoding would turn the neutral stored value into about , so instead of : a flat texel would tilt the normal.
Interpolation or compression may make nonunit, so if normalize it, or equivalently normalize the final vector:
For the orthonormal frame, the denominator is , hence nonzero exactly when . A zero decoded vector has no direction and needs a specified policy. For a two-sided surface, selecting the face orientation and modifying the frame must also follow a stated convention; flipping only one axis can change handedness. Use with a light direction expressed in the same space. For a diffuse cosine model the factor is when is a unit direction toward the light; this is only one part of a lighting calculation.
Worked example 3.5.7
(Decode and light a tilted normal)
With , , and sample , the decoded vector is . Thus . For the diffuse cosine is ; for it is . A neutral sample instead yields . These calculations assume the declared linear encoding, not arbitrary image color management.
Counterexample mode
A tangent-space triple is not a world vector
On a surface with , and , a decoded tangent-space vector maps to . Reading the same triple directly as world coordinates instead gives , perpendicular to the correct direction. The repair is to transform through the frame used by the asset, then compare vectors in one coordinate system.
Under a nonsingular model transform , geometric tangents transform by and normals by , before appropriate normalization. A nonuniform scale generally destroys orthogonality among directly transformed frame axes; reconstructing and orthonormalizing the frame in the target space is one defined convention. It is not generally identical to transforming an already perturbed normal by , so the pipeline and its baking assumptions must agree. Singular transforms have no inverse-transpose normal matrix. Linear interpolation of vertex tangents and normals also does not preserve unit length or orthogonality; a fragment-level reconstruction must check its nonzero denominators.
Exercises
Concept lensAlgebraic
Lighting in tangent space or in world space
Put the frame vectors in the columns of . Orthonormality makes orthogonal, so . The world-space normal is , and : one may instead rotate the light into tangent space and keep fixed. For , , , and , both routes give . The agreement depends on the frame being orthonormal; a sheared or scaled frame would break it.
Quick check
(Use , and UV differences , to find and .)
Solution · Answer
, and . Substitution into both edge equations verifies the result.
Quick check
(Let and . Find the projected unit tangent. If , determine under the convention above.)
Solution · Answer
The projection is , already unit, so . Since , and .
Quick check
(With the identity frame, decode and compute the unit normal. Find its cosine with .)
Solution · Answer
, giving and cosine .
Quick check
(The UV differences are and . Can the displayed derivative formulas be used? Explain what information is missing.)
Solution · Answer
. The second UV difference is twice the first. The derivative equations would therefore require , contradicting the nondegenerate geometric triangle assumed here. No affine UV-to-position derivative satisfies both equations. With degenerate geometry, the equations could instead be inconsistent or have nonunique solutions.
Quick check
(Why can a normal map change a lit interior pixel while the geometric silhouette remains unchanged?)
Solution · Answer
The map changes the normal supplied to the shading computation, but the stated model leaves vertex positions and primitive coverage unchanged. Silhouette changes require a geometric displacement or another explicitly specified coverage method.