Art of Illusion



To Documentation Index
Prev: The Properties Window Next: Example Materials

9. Example Textures

So now you know everything there is to know about using the procedure editor. Let's see some examples of what you can do with it!

Example 1: Bricks

Our first example is a brick texture:

Here is the procedure which generates it:

This is a fairly simple texture. The output of the Bricks module is sent through the Blend module, and used to select between two different colors: red for the bricks, and gray for the mortar. We could simply leave it at that and have a reasonable brick texture, but it would not be very convincing. It would be too perfect. If you look at any real brick wall, you will see a wide variety of discolorations in it - stains, variations in brick color, etc. We therefore use a Noise module to scale the brightness of the output color to create irregular stains on the wall. You can easily do something much fancier, but even this simple modification greatly improves the appearance of the texture.

In addition, the brick pattern is used as a bump map to make the bricks appear to stand out. Notice the use of a Blur module to slightly bevel the edges of the bricks. This makes the bump mapping slightly more noticeable.

Example 2: Wood

The next example is a wood texture:

Here is the procedure:

This uses the Distance 1 output of a Cells module to select a color from a custom color function. This creates a "knotted wood" effect - concentric circles about lots of centers. Of course, this by itself doesn't look much like wood. The circles are perfectly even and symmetrical. We therefore add a turbulence function to it disrupt the rings. The appearance of the pattern can be greatly changed by altering the amplitude of the turbulence function, or the number of octaves of noise.

Example 3: Mosaic

Our final example is more complicated: a mosaic of brightly colored stones.

Here is the procedure:

This procedure takes a little more work to understand. It is based around a Cells module. We begin by using a Subtract module to calculate D=(Distance 2)-(Distance 1). This is a function which is equal to 0 at the edges of the cells (in the middle of the gaps between the stones), and increases toward the center of each cell. A Greater Than module is used to compare D to 0.05. It outputs 1 inside the stones, and 0 in the gaps.

The Blend module is used to choose the diffuse color: grey for the mortar, or a variety of bright colors (generated by the HSV module) for the stones. Similarly, a Multiply module is used to calculate the specularity: 0 for the mortar (which should appear dull), and 0.2 for the stones (so that they appear shiny).

Finally, we use a custom function of D as a bump map. The function is flat for values less than 0.05 (so that the mortar is flat), then increases sharply before leveling off. This creates the effect of smoothly rounded stones set into the mortar.

Incidentally, the ground and sky in this image are also generated by procedural textures. They use Marble and Noise modules, respectively, to select colors from colormaps.

Prev: The Properties Window Next: Example Materials