Creating a noise texture using libnoise
To create a texture for use as a source of noise, we need some way to generate noise values. Implementing a proper noise generator from scratch can be a fairly daunting task. However, we can avoid that by making use of the very nice, open source library libnoise, available from http://libnoise.sourceforge.net. Libnoise is a C++ based library that is released under the Gnu LGPL. It provides a very simple and modular interface to coherent noise generation routines via noise modules. The modules can be chained and linked together in various ways to generate a wide variety of interesting generators. The website has a set of simple tutorials that can help get you started.
Downloading and compiling libnoise is fairly straightforward, and there is good documentation on the website just listed. However, if you are compiling for Windows using MinGW, you will need to make some adjustments to the Makefile in order to properly link the DLL.
In this recipe, we'll...