• Home
  • About
    • Biography
    • Contact Info
  • Projects
    • 2D Map Editor
    • Dodge and Destroy
    • Intruder's Run
    • Procedural Terrain
    • Jim Bob's Jam
Nickpdevelop.net

Procedural Terrain


Project Information

Written in C++, using Direct3D10, HLSL, and Direct Input

Game engine I wrote to procedural generate terrain. The player moves around the world in first person, and the camera is floating at above the current height of the terrain. Support for infinite map generation is included via a hashed data structure. Terrain is subdivided into separate regions to improve performance in infinite maps. Current issues include seams between regions being noticeable.

Updates planned for the project include adding random water springs, which will lead to creating a river generation algorithm. Eventually I want to update the system to render using a voxel based data structure to allow for more interesting features, as well as updating the texture mapping.

Implementation Details

Uses a 2D PerlinNoise function, with a unique seed upon start of the application. Elevation data is then stored into a hash map and is accessed through 2D region coordinates. The lighting model I used is the per-pixel Blinn-Phong model. The texture is done through what I like to call a height graph. For each texture a ratio is calculated depending on the height at a particular vertex, and these ratios determine how much from each texture to blend.