ChrisPritchard / Heightmaps

A collection of heightmap generators, along with some bmp/ppm image format savers

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Heightmaps

A collection of heightmap generators, along with some bmp/ppm image format savers.

Diamond Square. Perfect, but very, very slow Perlin noise. Famous from Tron Simplex noise. My eyes!

No external libraries have been used (except for the SDL C library), so this project will hopefully serve as a good reference source for a raw F# implementation of these algorithms.

Currently, Diamond Square, Perlin noise and Simplex noise have been implemented, with the PPM format (P6), BMP format (24bit) and a SDL renderer. You can find the implementations of each in the appropriately named F# files - each file is completely self contained.

The project is a console app. It will take command-line arguments to configure (instructions can be seen by running it with 'help', or seeing the definition in the code here.

If -bitmap or -ppm is not specified, the default is to render the generated image on a SDL surface. If so, the image can be regenerated using the R key, or the program can be quit using the escape key.

NOTE: some safe defaults, like the range reduction in diamond square and the perlin noise period cannot be set using the CLI tool. However, the algorithms are generally written so these variables are easy to override if needed.

The version of SDL shipped with this is for 64bit windows. Replacing the SDL.dll file with versions for other operating systems should work fine. Other versions can be found here.

About

A collection of heightmap generators, along with some bmp/ppm image format savers

License:The Unlicense


Languages

Language:F# 100.0%