Procedural terrain generation

Anything and everything that's related to OGRE or the wider graphics field that doesn't fit into the other forums.
Post Reply
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Procedural terrain generation

Post by zarthrag »

I'm looking to build maps for PLSM2 in the "laziest" way possible (i.e. procedurally). I plan to use some sort for fractal terrain generation for each page, which is then brushed/stitched together to the adjecent pages - or something like that.

The idea is to create an expansive, high-resolution set of heightmaps based off of lower detail ones. The "main"/high-level image should be RGB, with varying combinations of color indicating the *type* of terrain in that page. (Steppe, Desert, Plains, Forest, Mountains, Hills, etc.) The alpha value determines the overall/average altitude of that page/area. (To allow for oceans and such.)

The game this is being used for is somewhat of a (but not really) a flight-simulator. I hope to be using the listener to add-in (VERY large) cities/buildings.

My question is: Are there already implementations of terrain generators that can produce generic terrain heightmaps using just a few variables as a guide? (I plan to pre-process every bit of data that I possibly can. Including PVS.) I've seen lots of "by hand" editors, and those are great. But I need an entire planet's worth of heightmaps! Are there tutorials on how to manipulate reams of heightfield data?
User avatar
tuan kuranes
OGRE Retired Moderator
OGRE Retired Moderator
Posts: 2653
Joined: Wed Sep 24, 2003 8:07 am
Location: Haute Garonne, France
x 4
Contact:

Post by tuan kuranes »

Look at libnoise (link in assembling a toolset wiki).
they even have a sample of how to generate a planet.
User avatar
Azatoth
Gnome
Posts: 327
Joined: Sat Jul 10, 2004 6:46 pm
Location: Sweden
x 4
Contact:

Post by Azatoth »

The Mercator lib in the Worldforge project does this. You define "basepoints" (heighvalues) at an set interval (64 units), and then a heightmap is generated. There are also shaders available, which can generate cover maps for grass,snow etc.
http://www.worldforge.org/dev/eng/libraries/mercator
User avatar
Lucky_Luciano
Greenskin
Posts: 136
Joined: Mon Feb 14, 2005 9:25 pm
Location: Belgium

Re: Procedural terrain generation

Post by Lucky_Luciano »

zarthrag wrote:(I plan to pre-process every bit of data that I possibly can. Including PVS.)
Just as a side note: if you are going to use your terrain in a flight simulator there isn't much use in calculating the PVS. When high above the terrain nothing will get culled anyway...
PVS is only helpfull when the player walks on a rocky terrrain where the view gets obscured by many mountains/valleys.
User avatar
zarthrag
Greenskin
Posts: 128
Joined: Sat Jul 24, 2004 9:07 am
Location: Tulsa, Oklahoma

Post by zarthrag »

More accurately, it's a "multi-vehicle" sim. There are many mech-equivalents as well as flying things, and most of the player's flying is in close proximity to the ground/buildings. Some river-valleys are supposed to be present too. The story takes place across an entire (but not quite to scale) planet, with combat over every inch of it.

I just looked at the mercator lib right now, it's pretty close to what I need, but I can't tell if it allows varied terrain types right off the bat. It does the basics, but not quite enough.

I checked out libnoise, that's an *excellent* suggestion. By building modules to generate each selected terrain type, it's easy to build a selector that will smoothly toggle between terrain types based on the data for that sector. Writing a command-line app to preprocess maps and compress them in batches should be a snap. Additionally, A billion other things can be done with this, thanks!
Post Reply