Procedural textures basics

Describes: adding a texture, modifying the bound box, editing a texture and its Alpha Channel.

Texture application can be scaled and moved, and is always aligned to the surface bound box. For now let's assume that the object to be textured is composed by only one surface, this way the object bound box will coincide with the surface's one and will make easier to visualize how it works. We'll use a cube, as a cube's bound box is the cube itself.

Add a cube, select it and open Materials Panel with F7. Click on the Available Maps/Textures cycle gadget to show the list of available procedurals. Select Granite and apply it to the active map/texture list with the transport (>>) gadget. This will activate the Edit gadget, allowing to change the texture's parameters and also will activate the "%W" and "Tile W" gadgets in the above area that are ghosted for two-dimensional image maps.

Granite texture default appearance

The material preview will show a rather uniteresting reddish tint. The reason why Red and its shades are often the Texture's default color is that the Red Channel of a brushmap or texture controls single-value attributes like bump, diffuse and so on.

Click on Edit to open the Texture Panel, then click on Show to have a quick look at a slice of the "granite" proce dure. You'll notice the granite here is much more sharply defined than it was in the material preview. The reason is that the fourth column of gadgets is the texture's local Alpha Channel value, and many parameters are set way less than one.

Texture Panel

Since Granite uses only the first two colors, let's change the fourth column value for Colors 1 & 2 to 1.0. Then click accept. The Material preview will be updated.

Granite texture appearance when fully applied

Disable Smooth Shading so that we'll be able to see the undistorted pattern on the cube, and accept the materi als Panel. Show the object in mode 8, and have a good look at the pattern it makes.

Editing U,V Tile

Now reopen Materials Panel, and edit the U and V Tile parameters, bringing them to 2.0 and leaving W untouched. Accept, redraw and you'll see the texture has been scaled, it is now twice as large so you can see a larger portion of it. Repeat lowering the U and V Tile parameters to .5; this will have the opposite effect, a smaller portion of the texture will fill the same space and more detail will be visible.

U and V Tile set to 2.0, 1.0, and 0.5: the textured area seems to zoom in

Repeat the above steps varying only one of the U or V parameters at a time, and resetting the other to 1.0 to appreciate the full effect. The texture will be stretched or compressed on the appropriate axes.

Procedural textures react to Tile changes in the same way brushmap do with a significant difference: instead of repeating the same image over and over when shrunk (tiling) or repeating its pixels when enlarged ( scaling) procedural textures level of detail is infinite and their imagery never gets repeated.

Loading and rendering or previewing the sample project "TextureUVtile.prj" provides a animated demon stration of texture level of detail.

Editing U,V %

Editing U and V % parameters can be done much in the same way Tile parameters were edited. Reset the cube's U and V Tile values to 1.0 and change U % value from 0.0 to 0.1. Exit and preview it.

The texture will appear to have moved along its 'X' axis, but apart from this shifting the pattern looks like the original one. Repeat this step for V and there will be another shift along Y axis, but the basic pattern will be the same. Negative values move in the opposite direction. Loading and rendering or previewing the sample project "TextureUVpercent.prj" provides an animated demonstra tion of textures moving along axes.

Editing the W component

So far it has been like moving or scaling a brushmap, except for the infinite detail. Procedural textures however are often three dimensional, something no 2D brushmap can be.

Select the cube and with Transformation Panel rotate it by -25.0 degrees along X axis and position it at -50.0 units on X. This will show both the front face seen until now and also the previously invisible top face. Open Materials Panel, reset U,V,W Tiling to 1.0 and U,V,W % to 0.0, push the Brightness slider to 100% then accept and redraw.

Now copy and paste the cube, moving one of the copies 100.0 units to the right so that the two cubes are placed side by side. In Material Panel set rightmost cube's W % value to .1 and look at the differences in perspective view. Both the front and the top face have changed appear ance. The top face has moved along the Z Axis, as it was logical to expect.

The arrow shows movement along +Z (W)

What is more interesting is that the front face changed appearance as well. This happened because the cube's front face now intersects a different "slice" of fractal noise. We can think 3D fractal noise as an infinite number of slightly different 2D brushmaps glued one to the other, like the pages of a book. The following image shows several slices of Granite texture receding into distance, note how the noise is always different yet it shares some basic similarities.

As Z (W) increases, the noise changes shape

W Tiling acts much in the same way but is usually less useful. Later in this chapter, the Properties Automor phing tutorial will explain how changing 'W' can effec tively animate the imagery in a very different way with respect to animating U or V.