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

Creating a sea rock material

Rocks on the sea edge are always fascinating. They are pounded at least twice a day through tides and storms. Life clings to them where it can and, apart from the natural elements that shape its surface, they are textured by birds and other transitory creatures that leave their mark on its surface.

Getting ready

You will need to load the rock-default.blend blendfile created earlier. Or if you have not been able to complete the previous recipe you can download the file from the Packt Publishing website.

Because we will be using this same blendfile for other recipes in this section you are advised to save it immediately after loading, and rename it Sea-Rock-00.blend.

How to do it...

Let' add an initial material to our rock mesh. To do so make sure the object is selected.

  1. Click the + button in the materials panel to create a new material and name it Sea-Rock.
  2. Set Diffuse color to R to 0.237, G to 0.234, and B to 0.205.
  3. Set the Specular type to Wardiso, with Intensity set to 0.014 and Slope to 0.400.
  4. All other settings in the materials panel can stay at their default values.

    Now, let's create some textures to define our sea rock surface.

  5. Switch to the Texture panel and create a new texture of Type Clouds and name it cloud.
  6. In the Clouds settings, ensure that Grayscale and Soft are selected as well as Basis of type Improved Perlin, Size of 0.60, and Depth of 5.
  7. Under Colors set Adjust/Brightness to 1.000, and Contrast to 3.500.
  8. Under Mapping set Size X to 1.00, Y to 2.00, and Z to 0.30.

    For the moment we will not use this texture to add any color, bump, or specular changes to our material. We will, however, use it to modify the shape of our rocks via the Modifiers panel. To use this ensure that your mesh has been set to Smooth shading and that you have a Subdivision Surface modifier already in the stack. The settings for this can be quite small at 2 Subdivision levels for View or Render.

  9. Switch to the Modifiers panel and add a new modifier of type Displace.
  10. Under Texture, click the checker icon and you should see your cloud texture as a selection. Select it and under Strength set the value to 0.100.

    You should immediately see the mesh distort slightly. If it's too much, reduce the Strength value a little more.

  11. Switch back to the Texture panel and deselect the cloud texture just created. The tick mark should be off. We will not be using this texture for any other purpose just yet.

    We could actually delete it here because that would only disconnect the texture from our material. It still exists because it's now being used by the Distort modifier. In fact, you may have noticed that a number has since appeared to the right of the texture name cloud. This shows that this texture is being used that number of times. It should be 2, because it's in the modifier and in the Material, even if it's not turned on at the moment. It sounds quite confusing but you don't need to worry about it at this stage.

  12. Select the next clear texture slot and click the new button. Select the Clouds texture type and name the texture rock-cracks.
  13. In the Clouds tab select Grayscale and Hard and set Depth to 6, and Size to 0.250.

    Under the Mapping tab change the Size Z value to 0.20.

  14. In the Influence tab change the Influence/Diffuse Color to 0.500. In the Geometry select Normal and set to -2.000.
  15. Under Blend, select type Multiply and check the Stencil checkbox. Finally, change the default color to R 0.05, G 0.04, and B 0.03.

Time to save your work to ensure you don't lose anything should the unforeseen happen. Name your file Sea-Rock-01.blend.

How to do it...

A quick render produces a quite nice rock. Remember, the only thing adding those deep and complex cracks and the green growth streaks is a simple cloud texture.

How it works…

Textures can be applied to an object in Blender other than via the materials settings. Here we used a texture that we temporarily loaded into a material texture slot and then applied it as a modifier to distort the mesh to give some variety to the surface. To use a texture for such purposes it must exist in the data structure of the blendfile. The easiest way to do this is to load it into a spare texture slot of a material, name it so it can be recognized, then use it with the modifier. Once that has been done you can 'unlink the datablock', from the material if you want. Alternatively, just leave the texture in the material but turn off its influence.

Employing a simple clouds texture to add vertical elongated cracks to our rocky surface is a really easy way to create larger rocks. Here we employed a scaled cloud texture to add both color and a bump to the surface. Procedural textures like cloud are ideal for this purpose as they are randomly generated just like the natural surface of rocks can be. However, cracks in large rocks tend to be in a certain direction and by rescaling in the Z axis we give the impression that the cracks are vertical striations. We had to reduce the Z scale to achieve this. Scaling below 1 will actually increase the stretch of a procedural texture. Scaling above 1 will squash the texture in the scaled axis.

Water can also play an important part in the surface properties, adding extra specularity and reflection at certain times of the day. We shall be dealing with water in later chapters, so for these recipes we will assume that the tide is out. We will combine future water exercises with some of these chapter rock recipes later.

See also

Chapter 6, Creating realistic large-scale water in Blender 2.5