procedural-terrain
procedural terrain generation
use
npm install
- there is different script which can be launched, the goal is to ease the development.
- it is useful to use --max_old_space_size=4096 to avoid running out of memory.
- the output files are huge uncompressed data. (2048x2048 take 325mo)
- be reasonable start with 512x512
node base.js <size> <output file>
node erosion.js <nb iteration> <input file> <output file>
node collapse.js <nb iteration> <input file> <output file>
node addColor.js <input file> <output file>
node city.js <nb iteration> <input file>
base.js
base.js generate some perlin noise to create the terrain.
erosion.js
erosion.js simulate rain erosion, by simulating drop of water rolling on the terrain.
collapse.js
collapse.js flatten the terrain between mountain and water
addColor.js
before calling this script, there is no color inside the .tmp file.
city.js
before to call this one, be sure to call addColor.js, else everything will be gray.
city.js create city on the part between mountain and water
canyon.js
stand-alone create a terrain which try to look like the grand canyon