P-152: Virtual World Concept Update 96: Fractal Terrain Generation Part 2
According to the comments I found within the project, the code that I have been examining is the “Infinite Universe Engine” by Jochen Winzen. I have no other information on it, but it seems to use a very similiar approach to rendering realistic world to the one that I intend to use.
This project uses “Fractal Midpoint Displacement” to generate its terrain. This is one of the most common algorithms for terrain generation, and uses the four edges of the quad as it’s basis. These edges are then subdivided and subdivided again to form the terrain.
The project, first of all, uses six quad trees, each one representing one side of a cube. These quad trees seem to be updated every frame using a distance-based calculation.
The algorithm seems to recursively generate the quad tree based on how many quad tree nodes are within a given “border” which surrounds the players position.
The terrain also changes at some point from sphere interpolation (at far view distances) to the actual fractal midpoint displacement (at near view distances). This is how the curvature of the earth is represented efficiently, while also allowing high detail flat terrains to be built.
The most critical piece of information that I have learned from this project however is the answer to the question of how the terrain is both generated on the fly, and reproduced accurately everytime a user returns to the same position on the terrain.
It seems, from looking through the code, that this project creates a model of the solar system, and contains DEM data (basically, heightfield data) on the planets. The project seems to load DEM data if it exists for the planet, and if it doesn’t, it creates a simple global heightfield.
This global heightfield seems to be the key. At long view distances, this heightfield is used by itself to render the terrain. As the user gets closer, the heightfield values are interpolated using 3d noise to produce a finer and finer dynamic terrain mesh as the user gets closer and closer to the surface of the terrain. This is extremely clever.
I will be creating entirely unique planets, so I will not have DEM or static heighfield data, but the project also allows for the dynamic creation of the global heightfield, so I can use this general approach in my project too. I had never thought of this, although some of my ideas were in the same ballpark. This should be the last piece of the puzzle that I need to modify my existing code to produce spherical fractal terrain.
