Procedural Texturing With Weightmaps

Lightwave's procedural surfacing features have dramatically improved since version 5, and they now provide a powerful alternative to using image maps. Although sometimes slower, they generally use less memory and provide a level of detail that can undergo close scrutiny.

This tutorial attempts to show some of the techniques available to users for creating realistic surfaces. It shows the creation of a large metal anvil; chosen because it is a simple model to create and a good candidate for procedural texturing. Instead of taking you through every surface setting, I will provide an overview of each stage and present images for reference. The final model and scene are available for download at the end of this tutorial.

Modelling

The first step is to create your model using subdivision surfaces (alternatively download the model on the next page). By using subdivision surfaces (i.e. hitting the "Tab" key), it gives greater adjustability when we use displacement maps later on. For reference I'd suggest using Google Image search; there's plenty of images out there that should be useful. Try to get as many as possible as it'll help when it comes to getting ideas on creating your procedural textures.

Anvil Model

Anvil Model

This model would be fine if we simply wanted to use image maps, but we need to make some adjustments to make it work better with the weight maps we'll be creating.

By subdividing certain areas (using a combination of Bandsaw and Smooth Shift), it will give us greater detail and control in making the weight map.

Subdividing the mesh

Subdividing the mesh

Weightmaps

Weightmaps are used in this tutorial to act like a paintbrush for your procedural textures. We can create a weightmap to dictate where a procedural texture should or should not appear.

Firstly we'll make a weightmap called "Smooth". This will be used to mark exposed areas on the object surface where it has been worn away and the surface is less rough. To create a weightmap, click on the "Map" tab at the top and go to "New Weight Map" on the left menu bar. Enter the name "Smooth" and set the initial value to 0%.

SUsing point selection mode, select all the points that are on the edges of the surface that protrude significantly (see image below). On the same menu bar, click "Set Map Value", select the "Smooth" weightmap in the drop down box, and enter 100% for "Value1".

Point Selection

Point Selection

Now press "z" to use the weightmap airbrush, press "n" to bring up the settings, and make sure you have the Weight Value set to 100%. Adjust the radius and strength to your liking, and use the airbrush to paint on other areas that you feel should be worn down and smoothed. Note that you will need to select the "Smooth" weightmap in the drop down list at the bottom right of the screen (making sure that the "W" is selected and not T or M), and set the viewport to "Weight Shade" to be able to see the effect you are having.

The Smooth weightmap

The Smooth weightmap

Once you have finished, create another weight map called "Dents" (with initial value of 0%) and use the airbrush again, but this time painting areas that should be dented or damaged.

The Dents weightmap

The Dents weightmap

You can see here why I decided to subdivide those particular parts of the mesh.

That's all you need to do in modeller. The next stage is the surfacing in Layout. If you want to download the model at this stage of the tutorial (i.e. without surfacing), use the link below.

Download: AnvilModel.zip (12.3 Kb)

Creating the scene

An important consideration when surfacing an object is setting up the lighting and environment so you can get the best feedback about the changes you are making. After all, what's the point in changing the reflectivity if there's nothing to reflect? When setting up the lighting you should try to have the following:

Key Light - Provides main diffuse lighting. Preferably set at an angle to give varied
lighting across the different surface directions. Try to leave one face dark, as this will help show reflectivity

Hair Light - Very bright light from behind. Highlights the edges of the object and helps to show up the bump channel

Point Lights - Try using a few point lights close to the surface to help show specularity

Ambient Light - Turn it off! This does nothing for you. It will hide the reflectivity in darker
areas, and any subtle changes that you make will be difficult to see.

It's also a good idea to have an object for your subject to reflect. I tend to use a luminous white half sphere to mimic a bright sky (with the "Hidden From Camera" option selected), but what you use is up to you.

You can download the scene below. The lighting is set to work with the anvil object downloaded from the previous page.

Download: AnvilScene.zip (2.98 Kb)

Bump Channel

I usually find that the bump channel is the best channel to start with. If you start with the colour channel, it can make it difficult to see what effect your adjustments on other channels are having. A good point to note is to make sure Anti-Aliasing is turned on when making your adjustments, as it makes a huge difference to the final appearance of the bump.

I said at the beginning of the tutorial that I wouldn't take you through too much detail of the surface parameters. The exception to this is the Bump channel, as I'll be introducing you to the concepts. For the other channels, I'll give you a view of the overall strategy, and then you can make up your own mind with regards to the aesthetics.

For the bump channel I used three components: a Crumple procedural for the main bump (removed from where the "Smooth" weightmap exists), a Hetero Terrain procedural for dents (specified by the "Dents" weightmap), and a Veins procedural. You can see each of these as it is applied in turn below (note that Diffuse has been temporarily reduced to 40% to prevent the lights from burning out the surface, and shadowing has been turned off)

Crumple

Crumple

Hetero Terrain

Hetero Terrain

Veins

Veins

Notice in the first picture how the Crumple procedural is not present where the "Smooth" weightmap is defined. The second picture is the other way round; the Hetero Terrain procedural is present where the "Dents" weightmap is defined. In the third picture, the Veins texture is very subtle but it is there! It helps to give the impression of grooves in the surface.

To create the Crumple procedural, you need two layers. One is the Crumple procedural, and the other is a gradient layer which is used in conjunction with the "Smooth" weightmap to alpha out the Crumple. To start, make the first layer in the bump channel a Crumple procedural texture with the following settings.

Layer Opacity 100%

Texture Value 45%

Frequencies 6

Small Power 0.75

The scale of the Crumple texture should be set to 15mm for all three directions (assuming you are either using the downloaded model, or are using a model of similar size).

Now add a new layer, change it's type to Gradient, and set the following keys:

Key 1 (Default Key):
Value 0%
Alpha 100%
Parameter -100%

Key 2:
Value 0%
Alpha 100%
Parameter 0%

Key 3:
Value 100%
Alpha 100%
Parameter 100%
The "Input Parameter" for the gradient should be set to "Weight Map", and the resulting "Weight Map" parameter set to "Smooth". Finally, set the layer mode to "Alpha", and invert the layer by using the "Invert Layer" check box at the top.

If you perform a quick render, you should see something similar to the first image on the previous page.

Now add a Hetero Terrain texture with the following settings:

Layer Opacity 100%

Texture Value -400%
Increment 0.67
Lacunarity 2.9
Octaves 6.0
Offset 0.47
Noise Type Perlin Noise

Scale X,Y,Z 180 mm

Copy the existing gradient layer. Paste it (using "Add To Layers"), make sure it is directly above the Hetero Terrain layer, and turn off the "Invert Layer" check box. Change the "Weight Map" parameter to "Dents".

Finally add a Veins procedural with the following parameters:

Layer Opacity 100%

Texture Value -15%
Coverage 0.3
Ledge Level 0.0
Ledge Width 0.02

Scale X,Y,Z 105 mm

That's the bump channel completed, and it should give you some idea about how to use gradients to modify procedural textures. A handy technique you might want to try, is by using more keyframes in a gradient, you can control how smoothly the texture fades in or out. This gives you a great deal of flexibility in controlling where your procedural appears.

Displacement Channel

The bump channel we just created is only a two dimensional effect, but it can be improved by combining its effect with the displacement channel.

IGo to the anvil object's properties, and select the "Deform" tab. Click on the "T" button to create a displacement texture. You will probably find that simply copying your bump channel layers into the displacement channel won't look very nice - I've found that you are generally better off starting from scratch.

For my anvil, I found that Crumple seemed to work best, and I used a gradient layer to only apply it where the "Dents" weight map existed. The settings I used for Crumple were:

Layer Opacity 100%

Displacement Axis Y
Texture Value -0.04
Frequencies 4

Small Power 0.75

The gradient layer used was almost identical to the second gradient layer from the bump channel.

The displacement channel helps to age the anvil and make it look a bit rougher

With displacement channel

With displacement channel

The great thing about procedurals, is that it's all completely adjustable via the weight map. So if you decide you want add aging marks to a different part of the model, it's just a matter of painting it on using the airbrush tool in Modeller.

Specular Channel

For the specular channel, we want the smooth parts of the object to have stronger highlights than the rest. We can do this by setting the overall value of the specular channel to zero, and then using a "Value" procedural set to 100% masked by a gradient responding to the "Smooth" weightmap.
To add to the realism we can add a Turbulence procedural to add texture to the highlights. Adding this sort of detail to the specularity channel is one of the best ways to make a surface look real.

With specular channel

With specular channel

In the end, I set the Value procedural to 120% in order to boost the highlights further. The "Colour Highlights" parameter on the "Advanced" tab was set to 70% in preparation for creating the colour channel. For details on the other parameters, download the finished object at the end of this tutorial.

Specular Channel

To colour the anvil, I used these four components in the colour channel (in order from bottom layer to top):

Base Colour - The main colour of the anvil (set in the main surface properties dialog), set to RGB = (81,70,68)

Smooth Colour - A "Value" procedural RGB = (141,132,126) masked by a gradient responding to the "Smooth" weightmap. Places colour highlights along the smooth parts.

Fractal Noise - A "Turbulence" procedural set to black at 50% opacity to add some dirt and noise to the colour channel.

Slope Based Rust - A gradient that places orange hilights on a particular gradient of slope. This
is then masked by another gradient to make sure it only applies to the bottom section of the anvil.

With specular channel

With specular channel

Fig 12

Fig 12

Base Colour

Fig 13

Fig 13

Smooth Colour

Fig 14

Fig 14

Fractal Noise

Fig 15

Fig 15

Slope Based Rust
The four pictures above show how the colour changes as each component is added in turn. The picture below shows the colour channel mixed with the bump and specular channels.

With colour channel

With colour channel

Diffuse Channel

The diffuse channel helps the object respond to light in a realistic manner. It defines the amount of light that is necessary for the surface to show its colour.

For the anvils diffuse channel, I have used a mix of some of the layers from both the bump channel and the colour channel, so that the diffuse channel is in sympathy with the other features. Put simply, the bumpy bits will appear darker, as will the dark parts of the colour channel. This helps to tie together the overall texturing scheme, and assists in the making the surface look photo real.

With diffuse channel

With diffuse channel

Reflection Channel

The final channel that we'll be dealing with is the reflection channel. The scene file that you might have downloaded earlier included a half sphere hidden from the camera to provide a reflection.

Turn on "Trace Shadows" and "Trace Reflections" in the rendering options. The reason shadows are turned on now is because it will plunge the front face of the anvil into darkness (providing you are using my lighting set up) and make some of the reflections easier to see and therefore to adjust.

The main reflection setting is set to 10%, and the texture has a "Turbulence" procedural layer set at 0% with 65% opacity to add detail to the reflective surface, in a similar way to the Turbulence procedural in the specular channel.

Finished Result

All done! We're left with what you hopefully will agree is a fairly realistic looking metal anvil. I hope you've picked up some tips about using the surface editor and gradient layers along the way.

As I mentioned earlier, the major advantage to this technique is that we have the final surface defined in terms of the models weightmaps. We can adjust them in Modeller and immediately see the surface respond to those changes.

The main reflection setting is set to 10%, and the texture has a "Turbulence" procedural layer set at 0% with 65% opacity to add detail to the reflective surface, in a similar way to the Turbulence procedural in the specular channel.

Finished result

Finished result

Fetching comments...

Post a comment