Fastest Thermal Erosion in the West
Introduction
My first thermal erosion algorithm has a lot of good features, and it’s faster than other ones, but I’m not totally satisfied by the timing performance, so I’ve developed a new thermal erosion algorithm that aims to be as fast as possible and to give good visual results as my first one.
Some technical info
In order to have a shorter execution time I’ve abandoned the reversed structure based on two phases of the previous implementations.
Now all the fragments can compute how much terrain has to go out and how much terrain has to come in without any data computed by the neighborhoods, this allows to reduce the execution times more than 50% (because the first phase disappear), as I’m going to show in the next benchmarks post.
Of course the new model is more empirical than my first one, and requires some assumptions that can give results that are less realistic, from a simulation point of view, but the results are good enough from the visual view, so this algorithm is a good compromise between performance and realism.
Erosion in action
As my first algorithm, also the new one continue the erosion for any number of iterations:
The previous group of images shows the same terrain eroded by 100, 200, 400 and 800 iterations. More iterations means a smoother and lower (on average) terrain.
The next image shows how the new algorithm erodes a (blurred) cube of rock:
The top left panel is the result of 50 iterations, the following ones (in clockwise) are the result of 100, 200 and 400 iterations. As it’s possible to notice, the new algorithm gives results similar to ones obtained by the first and third algorithms, but the eroded terrain is smoother like the one eroded by the second algorithm.
The new algorithm has just one parameter, c, that affects the level of erosion of the algorithm, as showed in the following image:
A lower value of c (0.25 in the top left panel) means more erosion, so a lower terrain, instead a bigger value (1.0 in the bottom right panel) means less erosion and an higher terrain.
Finally I want to compare the result of the erosion of my two algorithms:
On the left (bottom and top panels) there’s the same image of a terrain eroded by 100 iterations of my first algorithm, on the right there’s the terrain eroded by 50 iterations (top panel) and by 100 iterations (bottom panel).
I’ve compared a terrain eroded by 100 iterations with a terrain eroded by the half of iterations because I think they are more similar (on average height) than the two terrains eroded by 100 iterations and this is a good thing because that means I can get results similar to the ones I can get from the first algorithm using half the iterations, so shortening the times any more.
















