Blender 2.5 Materials and Textures Cookbook
上QQ阅读APP看书,第一时间看更新

Adding weathering by copying and reusing textures

In this recipe, we will add some weathering surface attributes by creating another material to represent nail rust running from underneath each slate as though rain has carried it down the roof.

Getting ready

This recipe picks up from the end of the last one. If you have not completed that recipe you can download the start blendfile from the Packtpub website: slate-roof-03.blend.

Open this file in Blender and continue with the following steps.

How to do it...

We first need to create a new material to provide the rust stains that will be applied in the material node tree. The easiest way to achieve this is to temporarily unlink the current material slate-roof from our object to create a new one. The slate-roof material still exists because it is assigned to the node material. Normally, objects can only have a single material assigned, although it is possible to have different materials assigned to vertex groups as will be shown in Chapter 8, Assigning more than one material to a surface.

In our case, it makes sense to temporarily unlink the slate-roof material, giving a clean slate to create a material to give weather and rust marks to the node material simulation.

  1. With the roof mesh object selected, and from the Materials panel, unlink the material datablock by clicking the X by the material name. This will not delete the material, just temporarily unlink it from our object.
  2. Create a new material and name it slate-stains.
  3. Set the Diffuse color to R 0.39, G 0.41, and B 0.45. Here, we use the default Lambert shader, which is fine for this part of the simulation.
  4. Set the Specular color to R 0.57, G 0.60, and B 0.62. Make it of type CookTorr with Intensity set to 0.087 and Hardness to 102. The color settings produce a slightly blue specular shine. This is also the default specular shader that again is fine for this simulation.

Now, let us add some textures to produce the weathering required.

  1. In the first slot of the Texture panel, select the slate-tile texture created earlier. Do this by clicking on the checker icon to the left of the texture name and choose from the list of textures displayed.
  2. Under the Influence tab, de-select Color. Select Geometry/Norm and set to 5.000. Set Blend to Mix, check Negative, RGB to Intensity, and Stencil.
  3. In the next free texture slot, create a new texture of type Distorted Noise and name it DistNoise.
  4. Under the Distorted Noise tab, ensure that Noise Distortion and Basis are both set to Blender Original. Set the Distortion to 1.000, and Size to 0.25.
  5. Under Influence/Diffuse, check the Color and set to 0.833. Set the Blend type to Mix, and from the color selector, set to R 0.31, G 0.16, and B 0.00.

The next texture will add some more variety to the weathering look we are after.

  1. In the next free texture slot, create a new texture of type Musgrave and name it Musgrave.
  2. Under the Musgrave tab, select type Multifractal and set the Dimension to 1.175, Lacunarity to 3.137, and Octaves to 6.433. Finally, set the Basis type to Blender Original with Size set to 0.09.
  3. Under Mapping, set the Coordinates type to Global.
  4. Under Influence/Diffuse, select Color and set to 0.297. Finally, set Blend type to Mix, set RGB to Intensity, and change the color selector to R 0.58, 0.69, B 0.74.

Save your work at this point, incrementing the file name to slate-roof-04.blend, and perform a test render.

How to do it...

The render should only show the effect of this material that produces a nice even slope to each slate with rust-colored stains that only begin from the point where the slates appear to overlap. It's also subtly mixed with some lighter streaking but again avoiding the places where slates overlap because of the stencil mask employed in the first texture.

How it works...

We utilized a method of reusing a texture between materials in this recipe, however, this is not the only method to do this. Blender allows you to copy or reuse textures in more than one way. Some offer the ability to copy and change settings while others will allow you to use a texture as a relative copy so that any changes you make to it, even if it's in another material, will change all occurrences within the blendfile.

In our example, we have used the same texture but in a new texture slot. As a result, we can make changes to the Influence settings separate from the settings in the other material slot. However, if you change the mapping in either texture, these settings will work across both textures. This is useful because we can have different settings for color, bump, or any of the influence attributes while only having to change the repeat setting in one of the image textures of the same name and the other will immediately match. Linking texture and materials, within and across blendfiles, will be discussed further in Chapter 4, Managing Blender Materials.

So, both of our materials share the same tiled image texture but we have added further procedural textures to alter the effect of the overall material to produce a weathered look. The Distorted Noise, and Musgrave textures add the rain and rust stains that once combined with our original slate-roof material will complete the material simulation.