Real-Time Shading

The previous chapter described the difference between fixed function, parameterized, programmable and procedural shaders. This chapter describes a parameterized shader capable of synthesizing the most commonly used textures found in procedural shaders.
Procedural solid texture mapping uses a mapping from solid texture coordinates s= (s, t, r) into a color space (R, G, B). Often procedural solid textures incorporate a color map. In such cases, p(s)= c( f(s)) consisting of an implicit classification of the texture space f(s) and a color map c (f). The color map c associates a color (R, G, B) with each index returned by the classification function f. The value returned by f can either be clamped or cycled to fall within the bounds of the color map. We assume that values of f from zero to one map to the extremes of the color table.
This section uses a single function f to generate a variety of procedural solid textures. This function is defined
where q(s) is a quadric classification function and n(s) is the Perlin noise function. The combination of quadrics and noise yields a specification sufficient to generate a wide variety of commonly used procedural solid textures. The affine transformations T i control the frequency and phase of the noise functions.
The function q() in Equation (10.1) is the quadric
which can be also represented as
using a homogeneous 4 4 matrix of coefficients...