[prev] Dirt [next]

Often realism in computer graphics can be greatly enhanced by adding imperfections to color textures. These naturally occurring features, a result of an object's exposure to the physical environment, can include rain staining, scratches, scarring, bleaching, corrosion and the accumulation of dirt.

[click to zoom]
Figure 33. Clean and Dirty

With the Dirt tool you can automatically calculate the later; dirt (black) is added to the polymesh color in crevices (see right side of Figure 33).

[no zoom]
Figure 34. Dirt Controls

The Dirt tool (see Figure 34) has three main parameters that control the dirt calculation process:

Radius
One way to think of this is to cover your object completely with dirt, then get a felt covered ball of the defined Radius and rub it over the surface. If the ball is large, large areas of the polymesh will stay dirty because the felt won't be able to reach them. But if the ball is small, then only narrow crevices will retain dirt.

As the
Radius increases, so too does the calculation time.

Grain
This controls the accuracy vs. speed of the dirt calculations. As you increase the Grain percentage, the speed increases but the accuracy drops. Reasonable values here are between 5% and 50%.

If the
Grain is very low there's a chance that the whole object gets colored black. This is a bug; increase the Grain until the problem disappears.

Smooth
Increase the Smooth amount to blur the final result.

[click to zoom]
Figure 35. Radius vs Grain

Figure 35 shows increasing Radius from bottom to top, and increasing Grain from left to right.

To calculate the dirt, click on the Calc button. It will turn into an Abort button, which you can use to stop the calculation before it would normally finish.

[no zoom]
Figure 36. Different Dirt Levels

Once the calculation is complete, you can change the Clean and Dirty gray levels if you wish. This is a "free" operation; the dirt doesn't need to be recalculated just to adjust appearance levels. The left side of Figure 36 shows black dirt, and the middle image has grey dirt.

The polymesh on the right side of Figure 36 has inverted levels, where the Clean level is grey, and the Dirty level is white. This could simulate a clean object that's been handled by someone with dirty hands.

When you're happy with the dirt appearance, add it to the polymesh color by clicking on Apply Dirt.

If you wish you can now add more dirt at a different Radius setting. Each Apply Dirt is accumulative, adding more dirt to previous applications.

Note: Dirt calculation times on large polymeshes can take several minutes, even hours in extreme cases. But the calculation is only performed on visible faces, so you can hide most of the polymesh, when fine tuning the dirt parameters, to speed up the initial trial-and-error process.

Also Note: Only levels of gray are defined for the dirt colors. In reality of course, dirt could be brown, or an odd shade of green, or a Purlin noise mixture of the two. Its beyond the scope of CySlice to provide all the possible appearances that dirt might take. But what you can do is use the gray dirt levels produced by CySlice as a parameter in a complex dirt shader.

In this case, its probably a good idea to have separate polymeshes, one for color and another for dirt information. Use the 3D Paint tool to edit/create the diffuse color, save the polymesh out, then Clear the color and apply the dirt. You can then use the 3D Paint tool again to edit the auto calculated dirt if required, adding more or cleaning other areas up.



[prev] [top] [next]