Endless Terrain

Fig 1 - Single terrain chunk
This project was a very experimental dive into terrain generation that came about in my general interest on the subject as well as my initial thesis plan being skewed towards some type of level or terrain generation. It ended up incorporating quite a lot of new things for me though. This is the first time I'd done any type of threading in unity, and the first time I made a serious script for making mesh in real time.

The mesh generation, put simply, is based off of using additive layers of perlin noise. The complete process involves making a noise map by layering perlin noise with each layer having a different detail level and persistence value. Taking the final height map I then create a mesh from each height at the vertex point mapped to a custom height curve. Almost everything about this is tweakable to let me play around with it as much as possible.

Fig 2 - Flat Shaded Setting
In addition to the mesh generation it also sports a set of features including flat shading, solid color mode for textures, both are used in figure 2, and endless terrain generation in play mode. The endless generation has controllable level of detail depending on distance from the viewer. Allowing me to make decreasingly taxing models to render in the background and make more detailed as the player gets close. I think one of the biggest time sinks for this project was getting the mesh edges to line up between different level of detail settings and getting the lighting to work well at them. Eventually I got a system for calculating an extra vertex around the mesh and having it all line up. For a short distance exaggerated look at level of detail figure 3 is using 3 different levels of detail.

Fig 3 - Flat Shaded Levels of Detail
There was still definitely some problems, it could be optimized more as there is a few millisecond slow down when trying to generate too many blocks at once. I think biomes and more variance would be a nice addition but for now I have chosen to move on and leave this piece as is.

2019 Justin Granger All rights reserved