Bump mapping

 

What is it?


Bump Mapping is a technique where we perturb the surface normal of the object being rendered. Modifying the normal of the object, results in changes to the shading calculation which give the illusion of depth (“bumps”). This is not to be confused with displacement mapping in which the actual shape of the object is being displaced along the surface normal.

The Basics


Bump mapping involves mapping each point on the object to UV coordinates (similar to texture mapping) however the UV coordinate is located in a normal map.  A normal map holds information about the direction of  the surface normal at each point on the object (based on UV mapping).


The image to the right is the normal map

used for the images to the left. Notice the

three axes I’ve drawn on the image. I’ve also

bound each axis to a colour, which also

happen to represent the three colours

comprising RGB (red, green, blue).


We now want to represent any

colour as a perturbation of the

surface normal. The only point of

notice is that the X, Y, Z values of

the normals range from [-1, 1] but

the RGB colours range from [0, 1].


Applying the equation:

Vector3D PerturbedNormal = 2.0 *( colourRead - 0.5) will change it appropriately.


The last step is to simply add the perturbed vector to the normally computed surface normal.

X-axis

Y-axis

Z-axis