All functions with the
heman_generate_ prefix are meant to help in the creation of interesting procedural imagery.
Noise and FBM¶
The image on the left is Ken Perlin’s simplex noise function, which is nice and continuous, but non-fractal. The image on the right adds up several octaves of that same noise function; this is known as Fractional Brownian Motion (FBM). This provides a way of generating fractal-like images that look cool when interpreted as a height map.
heman_generate_island_heightmap(int width, int height, int random_seed)¶
High-level function that uses several octaves of simplex noise and a signed distance field to generate an interesting height map.
Note that this function creates a “seed point” at the center of the image. To have control over the seed point, see
heman_generate_planet_heightmap(int width, int height, int random_seed)¶
High-level function that sums up several octaves of OpenSimplex noise over a 3D domain to generate an interesting lat-long height map. Clients should specify a width that is twice the value of height.
Heman proffers two high-level functions for generating archipelagos. They are similar to
heman_generate_island_heightmap but more flexible, allowing the user to specify custom seed points. The first function below generates only a height map; the latter can also generate “political” colors.
heman_generate_archipelago_heightmap(int width, int height, heman_points* points, float noiseamt, int random_seed)¶
0.3 is a good choice for noiseamt, but 0 is useful for diagnostics, as seen in the leftmost panel below.
points can be a list of two-tuples (X Y) or three-tuples (X Y Strength).
The image below depicts the same archipelago using three different noise amounts.
heman_generate_archipelago_political(int width, int height, heman_points* points, const heman_color* colors, heman_color ocean, float noiseamt, int seed, heman_image** elevation, heman_image** political)¶
This is a fancier API that generates political colors as well as elevation data. Behind the scenes, it uses