Sign in to follow this  
rohit_arondekar

How to implement Canyonize and Glaciation filters ?

Recommended Posts

Hello, I am working on a simple terrain generator and I was looking to add erosion effects. I found out in the paper --> Terrain Modeling by Mathias Grumet(link to paper at bottom) that effects like Canyonize and Glaciate (as in Terragen) are actually post processing filters, image processing to be specific. I could not find anything on searching on google on how to implement these filters. I am taking a course on Image Processing but am still a beginner. However I know how convolution works but I don't understand how to go about implementing canyonize, glaciation and the other filters mentioned in the paper. Any kind of help will be greatly appreciated :) Terrain Modeling by Mathias Grumet --> www.matthias.grumet.name/terrainmodeling.pdf

Share this post


Link to post
Share on other sites
I had actually already gone through the matter on that site. I found terracing there but I could not find anything related to Canyonize or Glaciation. Am I missing something here ? Nobody seems to actually mention anything about these filters. Are they like fancy names for some standard image processing filters ?

Share this post


Link to post
Share on other sites
Canyonize sounds an awful lot like increasing contrast. You can do this with a gamma curve, or more advanced mechanisms (perlin's bias / gain functions, ...).

The paper states "Canyonize widens areas at the top to create valleys and canyons. ". Assuming you work on a regular grid, you cannot "widen" other than pulling neighborhood values up, so this scheme would be fitting.

Another way of looking at it:

Erosion removes soft particles of terrain, and leaves the hard rock strata. Assuming rock strata are course features, we could look at the soft particles as "noise" on top of our image, and the rock as the original signal. A way to "remove" noise is a bilateral filter, a edge preserving blur, which is easy to implement if you have a gaussian filter working. You can ask more info about it if you can't figure it out.

Glacialize could then be implemented as the reverse (selectively blurring only the edges).

Good luck!

Share this post


Link to post
Share on other sites
The best paper I have found regarding synthesis of realistic terrains is "Terrain Synthesis from Digital Elevation Models", and this also discusses the approach used by Terragen (ridged multi-perlin). There are several other products that produce eroded looking terrain like Bryce and Mojoworld (I think it's called).

The fractal generated ones never look good imo. Physical simulation of erosion is very difficult but can look good. This is not a "simple post processing effect", though -- it is a physical simulation and can be very difficult to program.

Anyway, I really like the approach presented in this paper because it allows you to generate an unlimited variety of different types of terrains provided that you can acquire some exemplars.

Share this post


Link to post
Share on other sites
A canyon is a heavily eroded river. How do you generate rivers? That is a much bigger issue than generating canyons. I have worked on three systems:

Brute force with a river height map;
Like in the paper, a height map for the river cuts through existing terrain. Easy but makes no sense geologically. If it cuts through mountains a simple multiply like in the paper is no good, or the river goes uphill. To have it always go down can result in illogically cutting massive ravines through mountains. Will create canyons simply by increasing the depth and width etc.

Iterative rainfall;
Start with an even texture, and a gravity map. The gravity map is generated based on the height map, a 2d vector pointing to the lowest neighboring pixel in the height map. Each pass, the color of the pixel is migrated down. Color (water) will accumulate in valleys and ruts. Overflow (color saturation) means the color is passed to the next lowest neighboring pixel. You will need at least 100 render passes for decent results for this.

Hunt for valleys;
Like iterative rainfall but faster. Search for valleys in the existing terrain using a quick wide spaced sampling. Do multiple passes to confirm valleys. Then do merge passes which join up patches of valley areas. You need to allow the merge to go uphill slightly if the terrain is random and not geologically formed (ie there are lots of pools of low land that don't join up). You will end up with a map of potential rivers. Use this to cut a definite river into the heightmap, ensuring a river that goes downhill and follows natural contours. Use the same map to generate a heightmap for the actual river grid. For canyons, an additional canyon map (just a spotty perlinesque texture) is used. Where the color coincides with the river, the river is cut deeper and wider.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this