Game Engineer

Terrain Generator

Terrain Generator

 
Terrain Generation

Terrain Generation

This is a terrain generator that I built that allows one to quickly generate terrain geometry with various Perlin noise parameters. One can then flexibly extract that data for geometry and vertex color data from binary files.

 

Cool Things I Did

The various parameter inputs I had into my Lua file were as follow:

  • Terrain Width and Height in X and Z direction

  • Terrain Geometry Density with Width and Height Subdivision Counts

  • Max Altitude: Controls height in the Y direction

  • Min Altitude Color: Color of terrain at 0 Y value

  • Max Altitude Color: Color of terrain at Max Altitude Y value

  • Perlin Noise Seed: Controls randomness

  • Perlin Octave Count: Controls iterations of Perlin Noise to perform

  • Perlin X Sample Multiplier: Controls rate of sampling in X direction. Should mostly be the same as Y Sampler.

  • Perlin Y Sampler Multiplier: Controls rate of sampling in Y direction. Should mostly be the same as the X Sampler.

    Shown below you can see a lua implemented input file to control the parameters of the terrain builder. Config is currently empty for possible future implementations.

Parameters

Utilizing a platform independent interface to use either OpenGL or Direct3D, I generated and drew 3D terrain geometry with various vertex color inputs. Aspects:

  • Created lua file format that would build to binary. Binary format would then be read in during run time

  • Terrain generated using Perlin noise

  • Designing simple to use interfaces

  • Created geometry winding order to adapt to OpenGL or Direct3D