next up previous contents
Next: 6.21.5 Other Noise Functions Up: 6.21 Procedural Texture Generation Previous: 6.21.3 High Resolution Filtering

6.21.4 Spectral Synthesis

Now that we can create a single frequency noise function using the framebuffer, we need to create the different octaves and to composite them into one texture. For each octave:
Scale the texture matrix by a power of 2 in both s and t.
Translate the texture matrix by a random offset in both s and t.
Set the texture wrap mode to GL_REPEAT for s and t.
Draw a textured rectangle.
Accumulate the color buffer contents.
The random translation is an attempt to minimize the amount of overlap between each octave's texels; without it, every octave would use texels from the same corner of the input image. The accumulation is typically done with a scale factor that controls the weight we want to give each octave.

David Blythe