Natural Variations

Why 2 tutorials for natural variations ? One for game artists - another one for architects ? Because game artists need a much more weathered look. Why are large scale variations so important for better renderings? Without variations buildings look monotonous, less realistic. Even adding tons of texture does not solve this. In any case also have a look at the RTT tutorial, which shows how to bake RichDirt results to a texture.

What causes large scale variations in the real world? Buildings get a ´tint´ from weathering via wind. Wind is stronger at the edges of a building and at the top, with strong impact on dust, dirt, rain. This tutorial shows how to easily add this effect with RichDirt.

Before After

More Advantages of the approach described here are:

  1. no manual painting required (save time)
  2. no memory for huge textures required
  3. fast rendering
  4. single setup for many different materials
  5. no precise uv mapping required

1. Load the tutorial scene

A copy of the tutorial model for mental ray is available here. For V-Ray click here. For RichDirt2 vr click here and for RichDirt2 mr click here. The file contains a simple scene. Simply click on the link to start the download (no registration required). Make sure you have gamma and LUT correction enabled for 3ds Max. Select Camera001. Render the scene:

Expert users can skip items 2 to 6.

2. Open the Compact Material Editor.

Create a new Multi/Sub Object material. Name this ´myMultiSub´.

3. Create a new mental ray Arch and Design material or V-Ray material.

Name this ´myWallMtl´. (Note: to easily export from 3ds Max to your game engine you might want to use a 3ds Max standard material instead. Many exporters have better support for the standard material).

4. Open ´myMultiSub´ material again.

Add ´myWallMtl´ to slots 2,3,4,5 of myMultiSub. Make sure to use -instances- (not copy, we want the same wall material used 4 times). Note: add can be done via drag and drop in 3ds Max. Your ´myMultiSub´ should now look like:

3ds Max MultiSub material with Rich Dirt textures

5. Now go back to ´myWallMtl´.

Click the diffuse color map button, to add a RichDirt texture. The Material/ Map Browser by default opens the ´Standard´ folder´ - RichDirt had been found in the mental ray folder for version 1.01, 1.05, 1.06. Starting with version 1.1 RichDirt is indeed in the standard folder and can be used the same for mental ray and V-Ray. Name the new texture ´WallDirt´.

6. Make the Dirt color -green-

Green is used here so it is easier to see the effect. Also change the ´Clean´ color to rgb 0.973, 0.851, 0.612. Select the ´Rich Building´ preset.

Activate the ´myMultiSub´ material again, and select the 2 walls in the viewport. In the material editor press the ´Assign Material to Selection´ button.

3ds Max - assign material to selection

If everything worked fine the image should look like below.

Rich Dirt Natural Variations tutorial

7. This image looks good ...

(except for the windows) but we still don´t have a ´large scale variation´ - the structures around the windows are identical all over the facade. The building edges have also the same intensity top+bottom, left+right.

How to add the large scale variations ? The following part of the tutorial dives deeper into realistic weathering. Step by step. Game Artists tune a city with all its buildings - use RichDirt with the steps below to get as much extra effects as possible, for free when doing texture baking.

8. Adding a large scale variation.

Our goal is to make it realistic, and we know that wind + rain + dust are the real forces for these variations. Click the RichDirt Radius map button - to add a Bitmap. In the 3ds Max Bitmap choose C:\Program Files\Autodesk\3ds Max 201X\plugins\RichDirt\wind.jpg. (The installation path is different for Max 2012, and for 3ds Max Design). You could also directly download the texture from the website (select it and right-mouse + save works in most browsers)

Using wind to drive variations

This texture needs to be applied in a way that it maps to the full facade, top to bottom, left to right. Typically select the main geometry, add a UV map modifier. Use box mapping, make the box match with the building, especially the upper edge should match. The -same- wind texture can be used for larger and smaller buildings - aspect ratio doesn´t matter here ! Render to get the following image:

wind applied to the building

9. Does the image above look real ? No ! Why ?

On real buildings more dirt is found in the lower part, as wind is slower and less rain washes less dirt away. How do we get this effect ? It is easy in 3ds Max. Make a copy of the wind bitmap. Invert the bitmap, but do -not- use the ´invert´ button - switch on ´Color map´ instead, and invert the function below by dragging left control point to 1.0, and the right control point to 0.0:

Invert wind map using 3ds Max bitmap output color map

10. Also adjust the output ´RGB Offset´ to 0.5.

What for ? The offset is to make sure the upper part of the texture isn´t completly black. Black would cause a radius of 0 cm (0 * 50 cm) , so inner occlusion wouldn´t find obstacles. Easy: Playing with amount and offset you can control how dirt is distributed over the building. If you weather several buildings of a city simply modify the rgb offset and you have a nice variation.



Control Distribution of Dirt with 3ds Max Bitmap Output

10.b Add the mirror material for the windows.

The tutorial uses a multi-sub material, which isn´t required for RichDirt. However the particular scene uses a single mesh, to assign a glass (mirror) material it is then required. Instead of a real glass use a mirror - this isn´t physically correct, but we don´t have anything inside the building so we don´t want transparency - also a game engine prefers reflectmaps Using just a reflection is easier to control. Add an arch and design material. Set reflectivity to 0.5. Set diffuse to 0.0. In the BRDF rollup switch on ´Custom Reflectivity Function´ and set the ´0 deg refl´ to 0.5 .

11. Now add streaks.

Create a 3ds Max composite map. Plug the existing (green) dirt in. Add a second layer for streaks. Create a new RichDirt, select Preset ´Below Bench (strong)´. Use red as its dirt color. Switch on inner occlusion (some of the benches are small so they are only found by io rays). Make sure the composite mode is ´darken´. Render:
(If you want more details (= substeps) how to add streaks see the architectural tutorial step 11)

Hm, no streaks visible - what happened ? IO dirt covers AO streaks - We forgot to enable streaks ´For IO´ in the streaks rollup. Do that now. Render:

Both Inner Occlusion and Ambient Occlusion Streaks are active

12. The next step is for dirt aficionados.

It shows how to add even more realism. Background - the streaks we have so far run down from the benches in a very even way. Real world benches have an area to the left and right that is ´eaten´ away because rain hits dust from the side. Typical values are 50 degrees for strong wind (upper part of a building) and 8 degree for ´average´ wind. How do we get these angles into the model ? Use wind.jpg again, this time non-inverted. White remains white. Gray remains gray. If we look at wind.jpg we see 0.16 for the darkest parts. And white (1.0) for the brightest ones. To map 0.16 to 8 deg we use a bitmap ´Output Amount´ of 50: 0.16 * 50 -> 8. The brightest parts then have a value of 50, which is what we wanted. Where to use these values ? Create a RichDirt with Preset ´Below Bench´. Set the spread manually to 1 degree. Assign the wind texture to the spread. The wind values are multiplied to the 1 degree, so we get our desired values of 8 to 50 deg. Use black and white as colors for dirt/clean.

Let´s check how the mask looks like:

Rich Dirt rain used as mask

We get different shapes for the area below benches, especially top versus bottom. This is exactly what we wanted !

13. Add the mask to the composite map that we created in Step 11.

Also create a RichDirt Splashes texture. The composite map now should have:

a) The ´RichBuilding´ texture that creates the large scale variation.
b) The Streaks + their Mask.
c) The Splashes (simply create a new RichDirt, Preset ´Splashes Variations´, use 5.0 for ´Lower Edge´ to get more splashes at the ground. Extend radius to 70cm. Use blue as dirt color for the start)

3ds Max composite map

Use ´Darken´ as mix mode for the composite map. Now render to check :

RichDirt with splashes, rain and natural variations

14. The last step - use real colors for dirt.

The easiest way is to take the clean color, make it darker and more saturated. We use slightly different colors for splashes and streaks to get a richer image. Also adjust glass (diffuse, reflectivity) to fit with weathered style. Mixing colors with the 3ds Max composite map can be tricky with the ´darken´ mode, it kind of requires that you indeed take dark colors for the streaks - which is good here as we want a really dirty image.

weathered image, using RichDirt Streak Maps and Dirt

For really dirty areas in a game the ´Subtract´ mode can be interesting. Use black for ´clean´ and a gray value for ´dirt´ and subtract them from the main layer - the main layer needs a soft brown color (here 0.97, 0.67, 0.28) to get nice subtractive results.

Really dirty area below a bench
Copyrights
mental images and mental ray, are registered trademarks, and are trademarks of mental images GmbH, in the U.S.A. and/or other countries. V-Ray and the V-Ray logo are registered trademarks of Chaos Software Ltd. in Bulgaria and/or other countries. Autodesk and 3ds Max are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. finalRender is a registered trademark of cebas Computer in Germany. All other brand names, product names, or trademarks belong to their respective holders.