# Generating Parametric Terrain

This topic is 5395 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

All the recent talk of using parametric surfaces (nurbs, spline, or subdivision meshes) to describe terrain, convinced me that it may be a good idea indeed. However, there is still one hurdle which I must overcome to be fully convinced: Suppose you wanted to generate the entire terrain procedurally, that is with zero artist involvement. How would you generate the parametric surface? In particular, how would you set up the generator to produce the type of terrain features which really make use of the main advantages of parametric surfaces - cliffs, overhangs, perhaps even caves?

##### Share on other sites
I would go for something like this:
1-First use standard algoritems (perlin-noise, hills, fault-lines,...) to get general shape of terrain.
2- Convert this to parametric surface
3- Use algoritems simmilar to metaballs to add or remove terrain. This could be used to both create caves and add overhangs. The hard part here is to decide where to add or remove, to create natural looking shapes. Perlin noise will probably be very usefull here again.
4- Then, as last part, use noise to add local detail. This part will probably be just before you render a patch, not even stored with data.

You might as well add some erosion simulation in there. A global one before 1 and 2 and small local scale one between 3 and 4.
Point 1 is same as standerd hightmap approach, so you can find tons of info about it.

##### Share on other sites
I'd just use vector-valued function(for example,3 perlin noises)
to generate surface. I mean something like

Vec3 surfacefunc(Vec3 p){
return somematrix*VectorNoise(p)+othermatrix*p;
}
Vec3 surface[1024*1024];
for(y=0;y<1024;y++){
for(x=0;x<1024;x++){
Surface[x+y*1024]=surfacefunc(Vec3(x,y,0));
}
}

so by cnanging matrices i can make it to produce heightfield terrain, or terrain with overhangs, or something else.

Also this code generates from plane. It's possible to generate from different topological things such as sphere, toroid, toroid with N holes,etc.....

[Edited by - Dmytry on October 11, 2004 3:28:52 PM]

##### Share on other sites
if you want it realistic, then it's way harder than just noises.
i've been at geological faculty for 6 months working on similliar project.
it's almost impossible IMHO.

##### Share on other sites
Well, totally realistic is hard . But even simple things, like perlin noise (i mean multioctave perlin) is pretty realistic.
Realistic enough for current rendering methods.
And of course there i posted simplest example. Of course surfacefunc can be(and in any real-world project will be) alot more complicated.

BTW, Voxel World is 100% procedural(zero artwork(i only choose colors)).
My clouds is also 100% procedural.

##### Share on other sites
And noise based generation is only a start. It can be continued by different erosion simulations and other post-processing. All this can create landscapes that average Joe can't tell from reality (the rendering after that is another thing).

##### Share on other sites
Three years ago I wrote an engine that could generate and render at interactive FPS a quasi infinite terrain with 1cm details (shaded). There was a very intricated correlation between a CLOD and quad-tree based algo (a kind of mix between chunked LODs and GeoMipMaps) and bicubic interpolation + seeded fractals. The seed was made of two 32 bit digits.

Thus infinite terrain for 64bits of data and zero artist work. Memory and hardware requirements were also very low.

##### Share on other sites
Quote:
 Original post by Charles BThree years ago I wrote an engine that could generate and render at interactive FPS a quasi infinite terrain with 1cm details (shaded). There was a very intricated correlation between a CLOD and quad-tree based algo (a kind of mix between chunked LODs and GeoMipMaps) and bicubic interpolation + seeded fractals. The seed was made of two 32 bit digits.Check the thread "post a picture of your terrain engine" (Google will find).Thus infinite terrain for 64bits of data and zero artist work. Memory and hardware requirements were also very low.

##### Share on other sites
Thanks for making the dirty job for me. I was in hurry. But I just realized I have kept the linky in my bookmarks ;/ Shame on me, next time I'll try to be less lazy.

BTW to expand the discussion and be more in topic. I still plan to take the main ideas and experiences I got from this demo to generalize the concept to arbitrary shapes and terrain generation procedures (fractal/streaming/mixed). But my optimal cross-platform math library is a priority atm and it will be used intensively later for such 3D softwares.

The main benefit of heightmaps was for collision detection, quick occlusion culling and quick self (static or dynamic) shadowing tricks (which were not implemented on the GDev sample but worked in a separate demo). Today with shaders or even SSE it would be quite possible on custom 'Bezier patches'. (very small rocks casting shadows). The fractal part and culling are very easy to port to arbitrary patches.

If someone is interested I can give some details and elements of my preliminary studies for this next gen terrain renderer.

##### Share on other sites
Ok, so to summarize and combine the suggested approaches, one would go something like this:

Generate some preliminary mesh. This could be a simple heightmap-like mesh or one that already has some overhangs and such. To do the latter, use a function that returns a full coordinate given a point input, rather than just a height. [Note: if the input is on a regular grid or similar, it may be a good idea that the returned point is horizontally not too far away from the input point]

Once the preliminary mesh is ready, overhangs etcetera can be added by locally applying special brushes, which may be caulculated from e.g. an erosion model (this may not be necessary if the preliminary mesh already contains such features).

Since I'm dealing with a planet renderer, are those things doable in realtime or near-realtime? I suppose the point->point function can be made fast enough, not sure about the brushes/erosion... For that matter, is there some way to approximate erosion, preferably with a speed/quality tradeoff and/or an incremental refinement option? I'm affraid I'm not very fluent when it comes to erosion simulation..

Charles B, I would love to hear some more details on the algorthims you are using/intending-to-use. Note that I'm more interested in the generation of problematic features, since I know quite well how to generate simple (heightmap-like) tarrain.

• 18
• 29
• 11
• 21
• 16