libpcg is a small library for procedural content generation. It consists of a random number generator and several texture-generation functions. It is currently limited to Perlin noise in 1 and 2 dimensions, and Turing's model of reaction-diffusion in 2 dimensions. Meinhardt's reaction-diffusion model is partially implemented, and probably just needs better initial values.
See the demo applications in tests/ for a few examples of what can be created
with this.
- heightmap: Sample of a simple terrain mapping using three Perlin noise
functions in 2d. Press any key for a new seed, or escape to exit.
- noise_1d: generates 1d Perlin noise as a GL_LUMINANCE texture. Press any key
to choose a different seed, or press escape to exit.
- noise_2d: generates 2d Perlin noise as a GL_LUMINANCE or GL_RGB texture.
Press 'c' to switch types, escape to exit, or any key to choose a different
seed.
- timing: Do a test of Perlin noise generation speed.
- reactdiff_2d: generates 2d reaction-diffusion GL_LUMINANCE textures. Defaults
to Turing's model, or press 'm' to switch to Meinhardt ('t' to go back).
Press 't' a second time to switch to a two-stage Turing model, producing
differently-sized spots. Press any other key to change seeds, or escape to
exit. For different spot sizes, vary the 's' argument to
create_2d_reaction_turing slightly in the source (note: smaller s requires
more iterations).
