
11.2. CPU textures 473
Figure 11.14: A contour pattern which with some added turbulence and appropriate
blend of color could resemble a three-dimensional wood grain pattern.
11.2.9 Contours
The contour pattern illustrated in figure 11.14 is derived from the basic bozo
texture by passing it through a periodic function, in this case a sinusoid, and
then thresholding the result as follows:
Given the point of interest as a (u, v, w) coordinat e.
n
u,v,w
=
1
2
(1 + sin(2πf
q
fNoise(u, v, w))
i f (n
u,v,w
> (1.0 − t)) {
return the color of the contour
}
e ls e retur n the background
The parameter t governs how thick the contours appear and f
q
is a measu r e
that can be