PlyEdit: Dirt

From Headus Docs

Jump to: navigation, search
Cover Page
About PlyEdit
Loading Meshes
Mesh Display
Basic Tools
    H - Hiding
    V - Voiding
    F - Filling
Brushes
    G - Mark
    3 - Noise
    4/5 - Sculpt
    6 - Smooth
    7 - Comb
Macros
Reduce/Multiply
Import Align Combine
Other Tools
    Body Dewobble
    3D Paint
    Dirt
Clean
Saving Meshes
Undo
Glossary
Download PDF
Fig 1. Clean and Dirty
Fig 1. Clean and Dirty
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. With the Dirt tool you can automatically calculate the later; dirt (black) is added to the polymesh color in crevices (see right side of Fig 1).
Fig 2. Dirt
Fig 2. Dirt

The Dirt tool (see Fig 2) 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.
Fig 3. Radius vs Grain
Fig 3. Radius vs Grain
Smooth 
Increase the Smooth amount to blur the final result.

Fig 3 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.
Fig 4. Different Dirt Levels
Fig 4. 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 Fig 4 shows black dirt, and the middle image has grey dirt.

The polymesh on the right side of Fig 4 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. 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 PlyEdit to provide all the possible appearances that dirt might take, but what you can do is use the gray dirt levels produced by PlyEdit 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.