Tag Archives: erosion

Erosion

I've been playing around with post-processing functions (so to speak) on the terrain heightfields. When I designed the current terrain engine, I did so in such a way that terrain chunks have some amount of overlap, with the idea being that a "small amount" of post-processing can be done on the heightfield while avoiding seams. Of course, the only way to do this for anything that requires information about surrounding heights is to compute some redundant information (i.e., to overlap tiles a bit) and discard it.

Inspired by http://www.decarpentier.nl/scape-procedural-extensions, I started playing with using finite differences to modulate the heightfield according to its normal vector. The results are very compelling, although I'm not getting as nice of results as Giliam yet, presumably because he's using an analytic derivative and distorting the input to the noise function, whereas I'm using a finite difference and just distorting texture coordinates.

Certainly looks promising.

Selective Erosion of Heightmaps Using Density Maps

In an improvement on the original heightmap erosion algorithm, which (roughly) approximates fluvial erosion in terrains, I have incorporated a density map as an input to the erosion shader.  This is almost identical to the algorithm explained several months ago, though it seems to work far better and produces very interesting results.

Given a simple Perlin noise density maps, interesting effects can be achieved in the final, eroded terrain:

The left map represents the heightmap, whereas the right image represents the terrain density map.  It is easy to see that parts of the height map have been severely eroded; while other parts have stayed intact (white areas on the density map correspond to areas of high terrain density where erosion will have less of an effect).  The effect in this case seems rather unrealistic, since real terrains would not erode in such a non-uniform way.  The threshold values in the shader, however, can be used to control the degree to which the density map influences the erosion factor of the shader.

With more tweaking, I believe that this algorithm will be able to produce some very interesting features in terrains, as well as add a heterogeneous feel to them.

An Original, Realistic Algorithm for Terrain Erosion

Yes, another non-music digression. I can't stand not to write about this though, considering the fact that I've had a serious breakthrough today with a new algorithm.

Here's the problem: erosion algorithms tend to produce a sort of homogeneous soup of terrain without recreating some of the more true-to-life effects such as fractal coastlines and such.  The solution? A terrain density map.  As far as I know, this is a completely original algorithm.  I've seen nothing like it in the literature, so I'm quite excited about having invented it.  The initial test runs also produced exciting results!

Here's the basic concept: real terrains are not homogeneous.  Not all dirt is created equal. So, along with a 2-dimensional array representing the heightmap of a terrain, we should also create an equally-sized 2-dimensional array representing the density (or integrity, if the term is preferred) of the terrain at each given point. The density array can be filled with a low-octave perlin noise function (I found two to three octaves to give optimal results, with a persistence of between 1.5 and 2).

Now, we perform an erosion algorithm as usual, except that we use the density of the terrain at each point as the threshold value for erosion. That is, if the amount of potential erosion at a point is less than the density of the terrain at that point, then the point will resist erosion. Ideally, this algorithm erodes terrain in a more coherent, less uniform way than typical thermal erosion algorithms. For example, coasts display some fractal dimension now since some areas of the terrain erode more easily than others.

A sample heightmap using the new algorithm:

The difference is most notable around the rivers, where the coasts clearly display some fractal coherence absent in thermal erosion algorithms. Notice that "noise" of the coastlines is clearly more coherent than single-octave noise, thanks to the perlin-based density map.

I am still trying to work out how to make the features appear larger (that is, make the coast even more jagged), since the heightmap, although nice, isn't drastically different from previous ones. I am quite confident, however, that there's a lot of potential in this new density erosion algorithm. Who knows, maybe this will be the future choice algorithm for procedural terrain erosion!