Jump to content
  • Advertisement
Sign in to follow this  
Mite51

Erosion on a heightmap

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Has anyone ever tried to simulate erosion on a heightmap or otherwise know of a good algorithm? I can generate a heightmap but on a large scale it seems to be missing something and I think adding some terrain "weathering" would go a long way to getting a more realistic look. Jason

Share this post


Link to post
Share on other sites
Advertisement
Yeah, I played around with it, and erosion adds a lot to a heightmap.
If you search on google you'll see g-forge, I believe, where they implemented different erosion techniques.
There's another program, made for heightmap editing which has many erosion funcitons. It was unique in that it allowed to you string the functions together graphically with inputs and outputs... It may have been called Wilbur, or I might be getting it confused with another. (It had a circuit design type interface, with discrete blocks representing functions with inputs and outputs.)

In the end, if you need to (or want to) code it yourself, I'd search google for Hydraulic erosion (water based erosion). Basically, if you can calculate the path for a river, you can do water based erosion. (Just drop a *lot* of droplets at "random" places all over the terrain.)

The only frustrating part of erosion is that you can't simulate it very well on a perpixel basis... as a function for a point... you really need to apply it to to a regularly spaced grid of points (for this reason you can't easily modify something like your perlin noise function to factor in erosion - it requires the values around it, and not just a few, water based erosion may cause alterations across a wide geographical area.)

If you're trying to code something up, I'd be interested...
In fact, I just had an interesting idea on how to calculate the stuff rather quickly/visualize it.

-Michael g.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
I did a project on it at college, and made a website about it.

http://www.shiftyeye.com/ajs/mountains.html

Should still work, though I haven't updated anything there in many years... I feel like it would be a good basic intro.

--ajas

Share this post


Link to post
Share on other sites
ajas, thats very cool, did you use and per height point data like soil depth or is that working on just the height map?

After looking at your stuff I am thinking of using an erosion model like you have described but adding some depth info like soil, sediment, gravel, rock (types?) which erode at different speeds. This might help solve that problem you mentioned about the thermal erosion smoothing out the original terrain details.

So if each height point had a data stack representing the material at a point stacked vertically you could roll ( downward erosion ) rock to sediment at one rate and sediment to sediment at another rate ( soil could be created by vegetation... ) then apply thermal erosion to only exposed rock. Eventually it will smooth out also, but the process might look more realistic.

Anyway, at first I was thinking a plain RTS game, but if I am going to put all this info in it I am starting to feel it should be more like Civ on steroids. Now I just have to finish my UI system :P

Jason

Share this post


Link to post
Share on other sites
Check out World Machine (http://www.world-machine.com), it has a very powerful erosion operator for heightfields. Might give you some ideas, or at least serve as a benchmark to measure against :-)

(Edit: Oops, sorry, wrong URL given. Now fixed. Thanks, Tomas)

[Edited by - assen on July 26, 2005 3:59:48 AM]

Share this post


Link to post
Share on other sites
Quote:
Original post by assen
Check out World Machine (http://www.worldmachine.com), it has a very powerful erosion operator for heightfields. Might give you some ideas, or at least serve as a benchmark to measure against :-)


Might want to try http://www.world-machine.com/ instead :)

Share this post


Link to post
Share on other sites
Ah, WorldMachine was the terrain utility I was referring to earlier. It has several very good erosion techniques.

Regarding your idea of height/columns for rock and sediment... I'd thought of that before, but never did implement it (unfortunately resulting in what appear like really soft dirt eroding down.
Anyway, I'd recommend instead of storing vertical columns or whatever, you can always just use multiple heightmaps - one for the rock (base) and a second for either the dirt, or the dirt offset.
Just don't allow the erosion process to pick up sediment from the rock areas. It should turn out pretty cool. Also, you can use that sediment depth information on coloring the heightmap and choosing foliage placement.

Good luck!

-Michael g.

Share this post


Link to post
Share on other sites
Quote:
http://www.shiftyeye.com/ajs/mountains.html
Dude that is really nice. Square-Square subdivision is exactly what I was needing but couldn't quite think of.
One comment though: the plural of vertex is vertices :)

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Quote:
Original post by zppz
Quote:
http://www.shiftyeye.com/ajs/mountains.html
Dude that is really nice. Square-Square subdivision is exactly what I was needing but couldn't quite think of.
One comment though: the plural of vertex is vertices :)


Ha! Well according to our artists, the singular of vertexes is vertice :)

The way I did soil vs rock was I kept both the heightmap of all the current verts, then also a corresponding heightmap of the rock-layer, defined as "the lowest z value this vert has ever had." So whenever I eroded sediment away, I just set the rock heightfield to the min of the two. So if I wanted to take the depth of the topsoil, I'd just take the difference... and then I set up different sedimentation constants for the different material. I also used the topsoil depth to do stuff like growing grass and trees, which (for a while, at least) affected the sedimentation constants as well. Using the vegetation as feedback into the erosion is very difficult to get right in all cases though... generally you find a set of values that works well, and then change the input characteristics not too much, and it looks all wrong again.

Yeah, Square-square kicks midpoint displacement's ass. That exponent parameter is pretty key though... and as far as I know, no one was doing that before me :) (this was back in 1999). Also, no one was using low-harmonic erosion as feedback into the regeneration of higher level fractals... So I like to feel like I contributed something, even if everyone ignored it!

Anyway, I have all that source lying around somewhere still, even though it's ancient and super-crappy. Whew. The one ingredient that I always really wanted to do but never got around to was being able to split these up into tiles, and process them individually recursing to higher and higher resolutions. The tricky part is communicating boundary contributions of sediment and water flow between ajacent tiles... there are a hundred ways to do it though. That would allow for some REALLY cool stuff, like distributed simulations, and building out whole vast landscapes of these. Some day.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!