The Crack Network Tool

Introduction

The principles

The interface

The cell distribution
The use of the current height field
The crack width
New Povray scenes provided for this tool
Some fun uses of this tool and the Povray scenes provided




Introduction

The ability to create a close-looking imitation of a river bed or a field fractured by drought is the starting idea for this tool.

The algorithms used in Geomorph for fracturing a terrain are mainly inspired by the article Image-Guided Fracture, from David Mould of the University of Saskatchewan. I adapted the concepts and added some features, like the ability to raise the cracks edges so that the surface looks like if it was shrinking when drying.

Because Geomorph is a design tool with which interactive feedback is required, the process is basically "non-realistic". This is faster and more creative than a real-world simulation process.

Depending on how you play with the parameters and from which height field you start, you can get a convincingly realistic result, or a fanciful one like cracks guided by a word.

From a realistic stance, when drying and cracking, an elastic surface like mud gives more or less regular hexagonally shaped cells. On the opposite, a non-elastic one like ceramic or most soils generally produces rectangular cells. The Geomorph's crack network tool produces hexagons, more or less regular. If you want rectangular cells, you can use instead the "fault pen" , setting the difference in altitude to 0 and drawing parallel / perpendicular cracks.

Notice that the crack network process can be slow, depending on the parameters, even if it's designed with an interactive use in mind.


The principles

Cracks are the boundaries of "cells". Differently stated, there is a crack where the distance between two cell centers is equal.

Mathematically, Geomorph's crack networks are Voronoi diagrams.

The generation process is roughly this one:
The current height field is typically used as a noise function for moving the boundaries in an irregular way.

The height field can also be used as a "guide" instead of a noise grid. In that case, the higher values of the height field act as a "fence" and forces a crack to appear. This allows, for instance, to use letters as a guide.


The interface

When you choose the voronoi tool in the tool dialog, you get this options dialog:


  • The average cell size is specified in percent of the linear size of the image. For instance, a 10% size gives 100 cells and 5% gives 400 cells.

  • The seed controls the pseudo-random generator, for any process requiring it, for instance when the displacement of cell centers is calculated. If you start from the same seed and the same image, you are supposed to get the same result.


  • The edge raising is used to emulate the shrinking of a drying surface. It is activated only after the cracks are calculated when hitting Apply.


The cell distribution



The examples are scaled down to half their linear size. In all cases, we begin with the default "subdivision 2" image, except when stated differently.

Uniform / random

The seeds, which are the cell centers, are scattered in a random way.
Centered / random

More seeds are "spilled" in the center of the terrain. Cells are smaller in the center. This gives more or less a "hammer blow" effect. The spacing is proportional to the square of the distance from the center.
Regular / perturbated

The seeds are regularly laid out on the surface. This gives regular hexagons, with a slight vertical stretch.
The seeds are then moved by a random amount, in a range specified by the user.
The example shows the effect of a random parameter of 0, 50 (default) and 100 on a uniform grey image. If you use a height field as noise, with the random parameter set to 0, the centers would be regularly spaced, but the lines wouldn't be straight.

Notes:
  1. The cell size is rounded to the nearest size for giving an even number of cells rows, otherwise the bottom row would be irregular.
  2. The hexagons are slightly stretched to produce a tileable height field. When rendering with Povray, scaling down the Z dimension by 0.866 should give regular hexagons.
Multi-scale distribution (for uniform and centered cell distribution only)

This options repeats the cracking process at a lower level scale, using the higher level boundaries as a guide.

The example shows the effect of a 1x+2x+4x scale.

The crack width is 1 and the grid size is 5% . First, the program computes a crack net with a cell size of 20% (4x), with a width of 4 pixels. On a second step, this net is reused for computing a crack net with a cell size of 10% and lines of 2 pixels, inside the bigger cells. The process is repeated a third time to compute 5% cells into the 10% cells, with boundaries of 1 pixel width.

Hint:
On a 512x512 grid, results are better when using a size less than 10% and a crack width of 1. In the case shown, the basic crack width has been decreased from 2 to 1.

Caution:
This can be a very long process, particularly when noise is applied and a small cell size is chosen.


Rendering of a multiscale crack network with cracknet_bumptest.pov





The use of the current height field

1. Using the height field as a noise source


A height field used as a noise source locally perturbs the cracks depending on the altitude value.
From left to right, the example shows what is produced with a noise level of 0, 50 and 100.



2. Using the height field as a "guide"


When using the "guide" option, the height field values are given a greater weight than with the "noise" option.
This is mainly intended to be used with a height field showing steep transitions from dark to clear areas. These transitions become "fences".
A check box allows to use a second height field to add some noise to the cracks in the uniform background. This secondary height field is of the "subdivision 1" kind. The seed and the roughness can be controlled.






The crack width

The cracks width is specified in pixels. It is an absolute parameter, so the resulting look depends on the size of the heigth field.

The width can also vary depending on the distance of the crack from the cell center. The rationale is that cracks are created by the surface tension, which makes the surface shrink until it "tears up". The tension can be regarded as constant per unit of surface. When going away from a cell center, the tension of each unit adds up to its neighbours until a crack is encountered, so that the shrinking stress can be considered stronger when the distance of the crack from the center of a cell is greater.



Fixed width, 1 / 2 / 4 (512x512)


Variable width, from 2 to 6 (512x512)




New Povray scenes provided for this tool

Crack networks can be used as a standard height field in a Povray scene.

They can also be used as a bump map on an infinite ground plane, like in the introductory image of this page. In that case, the network is tiled to fill the plane.

These new scenes are provided:
  1. cracknet_bumptest.pov shows the current height field as a bump map on an infinite plane. It is tuned to be used with the default camera 3. This is the scene used to render the multiscale example.
  2. cracknet.pov is a composite scene, using a ground map (the crack network) called group_map.png as a bump map and the current height field rendered in the usual way. It was used to render the introductory landscape of this page.
  3. cracknet_nobump.pov is a composite scene using the crack network as a foreground height field. It's more difficult to use than the former, because the crack network is not tiled. Edges must be hidden, for instance by parts of the background height field.
Example of cracknet_nobump.pov with a 2048x2048 ground height field



A new pigment map, maprock_redmud.inc is provided to work with these scenes. It is intended to reproduce sedimentary bands, when used as a gradient pattern.

For using cracknet.pov, you should start by defining a crack network and save it as ground_map.png. Then, you work on your main height field, which can be considered as a background terrain. A 512x512 height field is sufficient for such a map.

Similarly, when using cracknet_nobump.pov, you should start by saving your crack network as ground_map.png. In that case, better results are obtained with a huge height field, 1024x1024 or 2048x2048. Cracking such a height field usually requires enough time to prepare a coffee.

In both cases, you'll probably have to translate and scale both image objects in the Povray file to get a convincing result. As usual, these parameters are grouped at the end of the file, after the "**********" line.
 
Notice that the scenes do not have to be used with a crack network. Interesting results can also be produced, for instance, by using a wavy height field as the ground. Check this page.

Some additional hints:
  1. For all scenes, begin with the default camera 3.
  2. For larger cracks, results are more natural after smoothing the crack network with a radius of 1, or more with huge height fields.
This package contains further examples. One of these examples features trees generated with the java program Povtree. Another one is the introductory scene of this page adapted to be rendered as an height field instead of a map.





Some fun uses of this tool and the Povray scenes provided

1. Write a word

The image at the top of this page uses the word Geomorph as a guide.

For this purpose:
  1. Start with a black height field ("uniform" - the default height field - at 0% level).
  2. Choose the "draw" subdialog and write your text with a small continuous pen  at its maximum level. With a 512x512 map, the smallest size (radius of 2) gives the best result.
  3. Go back to the "edit" subdialog to choose the crack network tool, and set the height field use to "guide" instead of "noise".
Some hints:
  1. For thinning your letters, you can use the "crest" tool .
  2. For sharpening your letters, you can use the "threshold" tool to cut the range, and so cut the blurring, then use the "brightness / contrast" tool  to raise the constrast to the max, using the "auto" button.

2. Using a crack width of 0

Try to set the crack width to 0 and the edges level to 100%, then revert the result. You will get something like this:

With cracknet_bumptest.pov



With sea_and_fog.pov, non eroded and eroded




3. Using an other height field than a crack network as a normal map

See this page.

______________________

Written in December 2006

Back to the documentation index


Contact:    Patrice St-Gelais

SourceForge.net Logo