Here is the executable. Click and drag with the mouse to navigate. It's kind of fun to get up on top of a hill and watch lakes and rivers form.
I accomplished the basic goals of my project. My program does in fact generate somewhat decent looking heightfield landscapes, and it evolves
them over time to create a time-lapse style animation (albeit not quite as dramatically as I had hoped.) It uses a few central components to do so.
Initial fractal generation
Originally I had planned to model the overall geology of the landscape using faults and geologically based concepts. This turned out to not be
very realistic of an idea. Instead, I generate the initial landscape using a "plasma" fractal. This process is well documented in several places,
such as here.
Layered Height Field
The height field consists of three layers: rock, dirt, and water. Above a certain elevation, the water becomes snow.
Rock is generated only by the initial fractal generator. After the rock is
created, the program begins taking time steps.
In each time step, there is a chance of rain. If it does rain, each point in the heightfield is given an additional (gaussianly distributed) amount
There are two types of erosion modeled. In the first, any slope with at least a certain steepness will have tendency to slide down into all of its
lower neighbors. This affects snow, dirt, and rock, all to varying degrees. Any rock that erodes away is deposited as dirt.
The second type of erosion occurs with the flow of water. Once a point in the heightfield reaches a certain saturation level, water will flow out of
it (to only its lowest neighbor.) This will carry away both rock and dirt (dirt much more quickly than rock.)
Evaporation is applied to balance precipitation. In the beginning time steps of the simulation, evaporation is stunted to allow bodies of water to form.
Later it is increased to prevent flooding.
I ended up wasting a lot of time in work which came to nothing. For example, I planned to write a modified rendering routine to draw the landscape,
similar to Tim Clarke's Mars demo.
This was based on a ray-casting technique, and I felt that it would be faster and more flexible than rendering the polygons using OpenGL. This was
a silly idea. After spending about a day implementing it, it would have required a lot of optimization and tweaking to work even as well as the
opengl renderer, let alone better.
I also spent a lot of time coaxing the erosion model to produce reasonable results. The final selection ended up being very simple, and it turns
out that I was really a victim of my own over-analysis. Initially, I thought about the simple model and concluded that it would have too many problems
to be effective. specifically I was worried about convergence issues, and whether an erosion step could create a larger height difference than
originally existed. So I implemented two or three much more complex routines that never really worked. I went back to the simple model, and realized that
while my original concerns were justified, they did not affect land erosion within the parameters that are reasonable. In the water flow routines, these
effects actually turned out to create a very cool ripple effect on the surface of the water.
This turned out to be one of those projects that is never really done. Even as the models currently stand, the many parameters allow a lot
of changes to be explored. Fun things can be done with all kinds of different approaches to initial generation (I would still like to see about
geological type modelling). In my program, small streams do not tend to be very well-defined. This is mostly a scale problem, but there is probably
some sort of a hack that could make it work a little better. And of course, tons of other things could be added too.
Send mail to Eagle.