Bump mapping is an old trick of graphics programmers (1978 James Blinn) that creates the illusion of bump
surfaces through an adjusted shading computation without adding more geometry. Instead of using the surface
normal, a new normal is used for shading. The new normal can be adjusted by a 1d function (e.g. Perlin noise,
grayscale texture). This trick is much faster than doing real displacement mapping with minor short comings
(e.g. silhouettes, occlusion, shadows).
Without Bump Mapping
With Bump Mapping
With Bump and Normal Mapping
In real-time rendering, we usually use a variant of bump mapping called normal mapping (bluish textures).
Normal maps store a color in each pixel of the texture which is actually a 3d vector with the length of 1.
There are two ways to generate a normal map:
Create a normal map from a grayscale image - Precompute the difference of each pixel to its vertical and
horizontal neighbors. Convert the two resulting numbers (derivative) to a unit normal and store as color.
Bake the normal down from a high poly 3d model - Associate each pixel of a texture with a 3d surface
location on the high poly object and store its normal encoded as color.
In order to make the resulting texture reusable at any rotations, the normal vectors stored must be in tangent space,
which consists of 3 vectors generally referred to as: normal, tangent and binormal. It defines how the surface is oriented.
So by converting all normal into the tangent space, we can reuse them as they are now defined relative to the
surface. Tangent space mapping depends on the UV mapping of the object because the x and y direction in the
texture defines two vectors of the tangent space (tangent and binormal) in world space. It is difficult and
takes time to produce good UV mapping without seeing tangent space artifacts.
What if we want to use a 3d grayscale function like Perlin noise? The function does not require any UV mapping
and could improve the nearby detail rendering of bump surfaces. Implementing bump mapping without requiring
tangent space makes this possible.