Graphics Reference
In-Depth Information
point, that is, has a continuous second derivative. We can actually simplify this
further if we artificially choose to have the C 2 continuity be flat (that is, have
zero curvature).
Both here and for cubic noise, we have left the final function expressions
in symbolic form; for either the cubic or quintic case, and for either value or
gradient noise, it is a simple mater to put back in the polynomials for the B XX
coefficients and complete the function expressions. You can do this easily if
you want to work out the details or code these functions yourself.
Other Noise Concepts
Now that we have the fundamental concepts of noise in hand, let's look at
some other very useful concepts in noise functions. These are derived from the
basic noise functions discussed above, and in practice, are probably used more
often than pure noise functions.
Fractional Brownian Motion (FBM, 1/f, Octaves)
Fractional Brownian motion , or 1/f noise , is useful because it models an opera-
tion that has many different frequencies and magnitudes. It is relatively easy
to obtain this from simple noise functions. For each of several simple noise
functions that are defined at different frequencies, the magnitude of the noise
is divided by the frequency multiplier. It is usual to use powers of two for the
frequency multipliers, so in a given domain you would have multipliers of 2,
4, 8, 16, and so on. Each of these frequency doublings is called an octave . The
division of the magnitude by the frequency is the source of the name 1/f noise .
Code to create such a noise function is shown below, and Figure 10.4 shows
the noisegraph presentation of the effect as noise at different scales is summed
to get the final values.
float sum = 0.;
float size = 1.;
for( int i = 0; i < 4; i++ )
{
sum += noise( size * PP ) / size;
size *= 2.0;
}
float y = P.y + Amplitude * sum;
Search WWH ::




Custom Search