Terrain generation

Started by
19 comments, last by JTippetts 11 years, 2 months ago

Looks like your top only has a single octave of noise, while the bottom has multiple octaves. You can stack octaves of simplex noise just like you do with Perlin gradient noise to get more detail.

To wrap Perlin noise around a sphere, you can generate a sphere then use the 3D (x,y,z) coordinates of each face to evaluate a 3D noise function. Here is an example:

Create a cube and subdivide it using Catmull Rom subdivision. This has the effect of A) Rounding the cube toward a spherical shape and B) Providing you with regular quad faces, though there is some distortion at the places where the cube corners were subdivided.

W6xxQWv.png

Use the geometry of the sphere to evaluate a 3D noise function:

5hnBbh7.png

You can see that the noise is distributed smoothly across the surface of the sphere.

Now, use the generated noise to displace the surface of the sphere:

sm15bxh.png

To do a progressive LoD scheme from orbit to landing, I would probably go with something like this:

1) Use sub-divided cubes of progressively denser tesselation:

CkJkESv.png

2) At some point during de-orbit, when the planet is near enough that the mesh will be pretty dense, switch from a subdivided cube to a subdivided plane whose verts are mapped according to the section of the cube it is derived from. When this switch takes place is subject to experimentation. This process, again, could use multiple levels of subdivision as the lander draws nearer the ground.

During this process, the noise function can be adjusted based on distance, as well as adjusting the tesselation of the mesh. From a long way away, the number of octaves can be adjusted downward so that the function evaluates more quickly, since the majority of the smaller detail won't be noticeable and, in fact, can cause aliasing artifacts. As the planet draws nearer, more and more detail is revealed so at the same time that the visible area becomes restricted to a smaller and smaller piece of the globe, the detail of the noise function generating it becomes greater.

Now, this is not really a trivial thing you are doing here. If you are worried about performance from your noise fractal now, wait until you see how slow it becomes when you try to do things such as add terrain variations, as well as constructing it so that it can provide the detail needed for the final ground-level surface. You are going to need to build a decent background thread process that can generate the LoD levels in the background, and it's going to have to be pretty optimized. It can be done (look at Outerra ) but it is not a simple task at all. I think you would be well served to gain some solid experience with simpler terrain projects first, to learn the basic techniques you will need in order to complete the larger project.

Note that I still don't think a quadtree is appropriate; even more-so now, since if you want the player to be able to explore the entire planet (and not just some abstract, flat, infinite plane of terrain) then your terrain chunks will have to accept some level of distortion to preserve the curvature of the sphere, and this just wouldn't play well with the neat, tidy subdivision of a quadtree. Look at the faces in those subdivided cubes; some are relatively neat and square, while others are distorted. Since there is no way to tesselate a sphere with quads that are non-distorted, then I just don't think a quadtree would be appropriate.

This topic is closed to new replies.

Advertisement