Gradients:
Scary Textures of the Third Kind

[ PDF version for Print ]


Since LW-Version 6, image maps and procedural textures have a new brother: the Gradient. At first, nobody knew how to handle them, somehow they seemed to be kind of an alien thing. But having a closer look at them, they reveal an unexpected power and provide the possibility to create "intelligent surfaces".
This article is intended to give you a basic understanding through simple examples. How to set up a Gradient in detail can be read in the manual. But what they can be used for, and which effects they can produce - that are the questions I want to discuss here.

The basic idea behind Gradients is as simple as genial: Any surface property can be defined as dependent from a certain scene parameter. Think of it as an "expression for surfaces". A so called Input Parameter is the controlling scene variable, the actual gradient is used to assign different surface attributes to the different values this variable can have.



It's all about the Input!

The huge amount of potential uses unfolds, when you have a closer look at the available Input Parameters.


If you choose "Bump", then you can automatically adjust the color and specular values to match a procedural bump map.
In the Gradient, every Keyframe links a defined color (respectively a specular value) to an appointed bump depth. Furthermore, every Keyframe can have an Alpha value, causing the next texture layer to shine through.
Especially when you mix image maps and procedural textures to a multi-layered bump map, a Gradient comes handy for further refining of the surface.

In this example, a Gradient in the reflection and specular channel is used to dull the scratches, makes them appear less shiny. In the traditional way, you had to work with copies of all bump layers, and additionally you had to adjust the levels of the image map.
But the Gradient doesn't care about how the bump is done - he just takes the depth and assigns the matching reflection value.



There are many more Inputs available.

"Slope Angle", for example, causes snow to lie on horizontal parts only, and not to stick on the side of the rocks. Notice how the Gradient not only takes the Normals of geometry into account, moreover it also determines the simulated grooves of the bump map.
With "Light Incidence" the angle at which the Light hits the surface is handled as Input data.
Use this option to create your very own cell-shader or to bring some color variation into the shaded parts of your model (useful for velvet or silky materials).
"Incidence Angle" is an interesting option, too. It takes the viewing angle of the camera into account.
By using two opposite Gradients for the transparency and the reflection channel, you can simulate the Fresnel-effect, which is very important for believable glass or water.
Depending on the kind of object to be textured, there can be many other Input Parameters available.
So you can link material (plus other) properties to particle age, speed or acceleration.

Danger: Experiments on Animals!

At last, I want to point your attention to a very special Input Parameter.

Let's talk about Weight Maps.

This enables you to place different surface properties precisely on selected parts of the geometry, creating a kind of "virtual sub-surface". The first benefit of this method is the smooth blending between them, which is based in the nature of Gradients. Second, you can paint these WeightMaps directly on the 3D-geometry. This is a very painless and intuitive process, because you don't have unwrap the mesh or care about mapping coordinates.



In this example 8 WeightMaps are used to color the experimentation animal "Tasso".

8 according Gradients handle this coloring task. They have constant colors, the Keyframes are only set to define different Alpha values. This way the actual layer order is unimportant, because every color layer remains transparent for neutral weight values.

Please note, that WeightMaps can have negative values, too. So the neutral 0 level is located in the middle of the parameter scale, which means from the middle upwards the Gradient should be 100% transparent for proper blending.



Much more exciting possibilities appear, when you use the whole gradient as Alpha mask for the nest underlying layer.
Please have a look at this example: The Gradient, based on the "Nose" WeightMap, reveals the underlying procedural texture (Smoky2) just at Tasso's nose. In a similar way you could smoothly blend in imagemaps exactly at the desired parts of an object - without performing a single unwrap.

I hope this article could evoke some interest for the wonderful world of Gradients.
Of course, I'm all ears to your feedback.
Feel free to send comments, greetings or criticism to: Blochi@Blochi.com.