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.