Generating noise with different power spectra lawsWritten by Paul Bourke
There are many ways to characterise different noise sources, one is to consider the spectral density, that is, the mean square fluctuation at any particular frequency and how that varies with frequency. In what follows, noise will be generated that has spectral densities that vary as powers of inverse frequency, more precisely, the power spectra P(f) is proportional to 1 / fbeta for beta >= 0. When beta is 0 the noise is referred to white noise, when it is 2 it is referred to as Brownian noise, and when it is 1 it normally referred to simply as 1/f noise which occurs very often in processes found in nature.
White noise, beta = 0
Brownian noise, beta = 2
Note: Brownian noise is most easily generated by integrating white noise.
If one plots the log(power) vs log(frequency) for noise with a particular beta value, the slope gives the value of beta. This leads to the most obvious way to generate a noise signal with a particular beta. One generates the power spectrum with the appropriate distribution and then inverse fourier transforms that into the time domain, this technique is commonly called the fBm method and is used to create many natural looking fractal forms.
The basic method involves creating frequency components which have a magnitude that is generated from a Gaussian white process and scaled by the appropriate power of f. The phase is uniformly distributed on 0, 2pi. See the code at the end of this document for more precise details.
There is a relationship between the value of beta and the fractal dimension D, namely, D = (5 - beta) / 2
The following are examples of noise time series generated as described. They were all based upon the same initial seeds and therefore have the same general "shape".
beta = 1
beta = 1.5
beta = 2, Brownian noise (random walk)
beta = 2.5
beta = 3
A straightforward C program is given here that generates a noise series with a particular beta value. The RandomGaussian function returns a Gaussian white noise process with zero mean and unity standard deviation. RandomUniform returns a uniformly distributed noise process distributed between 0 to 1.
Deterministic 1/f noiseWritten by Paul Bourke
Listen to deterministic noise: QuickTime
1/f noise can be created using random noise generators but it can also be producted using deterministic functions. One such method is a finite difference equation proposed by I. Procaccia and H. Schuster. It is simply
A section of the time series is illustrated below.
The power spectra is shown below.
Procaccia, I. and Schuster, H.G.
Modelling fake planetsWritten by Paul Bourke
Greek version (Uses iso-8859-7 character set)
The following describes a method of creating realistic looking planetary models. The technique has been known for some time and is both an elegant and non-intuitive way of creating such fractal surfaces. The exact approach chosen here was to enable the models to be used in a variety of rendering packages, as such it is based upon facet approximations to a sphere. The same approach can readily be modified to deal with other data structures.
The sequence is illustrated below.
The above example and the ones that follow were created in an interactive OpenGL environment. While this leads to the ability to fly around and explore the models, it does restrict the rendering quality. It will be left to the reader to create more stunning images using their favorite rendering package.
An artifact of this method is that the planets have a mirror symmetry. A contour at a high elevation on one side of the planet will have a matching contour on the opposite side of the planet. In particular, if the planet is flood filled to some level, the outline of the land on one side will look the same as the outline of the water on the other side. This is clearly seen in the example below, the ocean on the left matches (given some mirror axes) the land on the opposite side of the planet as shown on the right.
An example application that implements the above is provided as simple OpenGL based program written in C: planet.c and planet.h. These should form a good basis for you own experimentation. For example, depending on the ability of your graphics card you might like to increase the maximum sphere resolution, test out more realistic colour maps, add cloud cover, etc. I'd be interested in seeing imagery resulting from this exploration. This code also supports frame sequential stereo if your OpenGL card supports it..... To find out about the basic operation of this program, after compiling it try "planet -h", this will give the command line options. The right mouse button (aka GLUT) will give a bunch of randomly organised options.Contribution by Julien Amsellem for 3DStudioMax
A version of the above can also be performed on the plane, that is, on each iteration choose two random points on the plane forming a cut line. The side of the plane on the left of the line is raised and the side on the right of the plane lowered. Performing this operation for various iteration counts is illustrated below where the height is mapped onto a grey scale.
Fractal LandscapesWritten by Paul Bourke
Fractal landscapes are often generated using a technique called spatial subdivision. For magical reasons this results in surfaces that are similar in appearance to the earth's terrain.
The idea behind spatial subdivision is quite
simple. Consider a square on the x-y plane,
The controls normally available when generating such landscapes are:
An application that creates fractal landscapes has been written by myself
It fully implements fractal terrain generation including
sea colour, background colour, terrain colour ramp,
lighting, rendering options,
9 initial points,
FracHill was primarily written as a creator of terrain models for other
3D modelling and rendering packages and thus provides
the ability to export the land surface in a number of CAD formats so that it
can be imported into 3D modelling packages.
The following shows a terrain surface at various grid resolutions from 2x2 to
In addition to wireframe views, FracHill performs other types of rendering
A well known artefact (bug) with terrains generated this way is the
appearance of "seams" or "creases". These generally occur along the edges
of the geometry associated with early iterations.
A clear example is shown below, notice the crease in the bottom left
part of the terrain highlighted by the shadow zone:
Heinz-Otto and Dietmar Saupe, The Science of Fractal Images, Springer-Verlag
The Synthesis and Rendering or Eroded Fractal Terrains, F.Kenton Musgrave, Craig E Kolb, Robert S. Mace, IEEE Computer Graphics & Applications
Frequency Synthesis of Landscapes (and clouds)Written by Paul Bourke
Frequency synthesis is based upon the observation that many "natural" forms and signals have a 1/fp frequency spectra, that is, their spectra falls off as the inverse of some power of the frequency where the power is related to the fractal dimension.This leads naturally to a method of generating such fractals:
In what follows this technique will be applied to 2 dimensional data, as will be seen, these look like terrain models when viewed as 3 dimensional models and clouds when viewed as 2 dimensional images.
To illustrate the process consider firstly a white noise signal in the spatial domain. To illustrate each stage both the image and 3D model will be shown together, the example below will use a 256 x 256 grid.
The next stage is to apply a fast Fourier transform to transfer the image into the frequency domain. For white noise this essentially looks like another noise field, the following shows the magnitude but remember each frequency component is a complex number, it has a real and imaginary part
Now we apply the 1/f filter. Note that the DC value is in the center of the image. This filter is applied to both the real and imaginary values of the harmonics in the frequency domain.
And lastly we transform back into the spatial domain with an inverse Fourier transform.
An important attribute of these images/models is that they tile perfectly, this is a direct result of the Fourier method which assumes periodic bounds. The following is a 2 x 2 tiling of the cloud-like image above, this suggests a way of creating tiled textures....but that's another story.
There are a number of ways of controlling how rough or smooth the surface is, the most obvious is to vary the power relationship. The following two images show the same surface as that used earlier (same random number sequence) but with a 1/f power of 1.8 and 2.4 respectively.
As with other fractal generation systems a particular image or surface is completely characterised by one number, namely the random number seed.
Bodies of water can be introduced by "flooding" the 3D models to some level. This is done simply by setting the height dimension of all grid cells to the flood level if the original height is less than the flood level.
And finally, a cloud background to a thin gold sheel with a cutout made from a fractal by Roger Bagula.