up to Schedule & Notes

Bump Mapping

A texture can model small height variations on a surface, causing the surface to appear slightly bumpy and more realistic. Below is a strawberry (from Blinn's 1976 paper on bump maps), which is modelled as a smooth surface, but has the appearance of bumps from a bump map.

The bump map texture is used to compute surface normals. Then the surface normals are use in Phong shading.

The surface is not changed ... just the lighting.

Below, the smooth surface is $P(s,t)$, the bump map is $h(s,t)$, and the virtual surface is $P'(s,t)$.

$P'$ is constructed by adding the heights, $h$, in the direction of $P$'s normal, $N$. Note that the heights are scalar values stored in the bump map.

$P'(s,t) = P(s,t) + h(s,t) N(s,t)$

The surface is parameterized by $s$ and $t$:

The virtual surface, $P'$, is not constructed. Only its normal, $N'$, is needed in the Phong lighting calculation.

Note that $N'$ is in the direction of the cross product of the partial derivatives, $P'_s$ and $P'_t$:

$N'(s,t) = P'_s(s,t) \times P'_t(s,t)$

Then

$\begin{array}{rl} P'_s & = { \partial \over \partial s} ( P + h N ) \\ & = P_s + h_s N + h N_s \\ & \approx P_s + h_s N \end{array}$

because $h N_s$ is very small if $h$ is small and $N_s$ is small, as on a smooth surface.

Similarly,

$P'_t \approx P_t + h_t N$

So

$\begin{array}{rl} N' & = P'_s \times P'_t \\ & \approx (P_s + h_s N) \times (P_t + h_t N) \\ & = P_s \times P_t + P_s \times h_t N + h_s N \times P_t + h_s N \times h_t N \\ & = N + h_t (P_s \times N) - h_s (P_t \times N) \\ & \approx N - h_t P_t - h_s P_s \\ \end{array}$

$P_s$ and $P_t$ are known from the surface parameterization, so we just need to compute $h_s$ and $h_t$ from $h(s,t)$. That can be done, approximately, using finite differences:

$h_s(s,t) \approx { \large h(s + \Delta s, t ) - h(s,t) \over \large \Delta s }$

$h_t(s,t) \approx { \large h(s, t + \Delta t ) - h(s,t) \over \large \Delta t }$

This can be efficiently computed on the GPU.

Results

Bump mapping does not displace the surface; it just changes the shading of the existing smooth surface. This is particularly obvious on the object's silhouette, as shown below (from Wikipedia). The left sphere is bump mapped, with a smooth silhouette, while the right sphere is displacement mapped, which causes the surface geometry to be changed.

up to Schedule & Notes