Book Image

Blender 2.5 Materials and Textures Cookbook

Book Image

Blender 2.5 Materials and Textures Cookbook

Overview of this book

Blender 2.5 is one of the most usable 3D suites available. Its material and texture functions offer spectacular surface creation possibilities. It can take you hours just to create basic textures and materials in Blender and when you think of creating complex materials and textures you are petrified. Imagine how you will feel when you overcome these obstacles. This book wastes no time on boring theory and bombards you with examples of ready-created materials and textures from the start, with clear instructions on how they were created, and what you can learn from them for making your own. It covers all core Blender functions you will ever need to easily create perfect simulation of objects from the simplest to the most complex ones. The book begins with recipes that show you how to create natural surface materials, including a variety of pebbles, rocks, wood, and water, as well as man-made metals, complete with rust. By utilizing some of the easiest-to-use animation tools available, you will be able to produce accurate movement in mesh objects. Familiarize yourself with a plethora of tools that will help you to effectively organize your textures and materials. You will learn how to emulate the reflective properties of natural materials and how to simulate materials such as rusted iron, which is difficult to make believable. Transparency and reflection are both tricky natural surface properties to simulate but these recipes will make it easy. Explore ways to speed up animations by using special painting techniques to significantly lower render times. By the end of the book, you will be able to simulate some of the most difficult effects to recreate in any 3D suite, such as smoke, fire, and explosions.
Table of Contents (16 chapters)
Blender 2.5 Materials and Textures Cookbook
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Creating a gray limestone pebble


One of the simplest materials to create is a gray sandstone pebble using just procedural textures. We will apply this material again in other recipes that follow so the naming of each material will become clearer as you work your way through each recipe. If you start any of the recipes out of order you can still complete them by downloading the named blendfiles of any of the uncompleted preceding recipes.

Getting ready

You will need to have created the base mesh as described above. However, you can also download a starting blendfile from the Packt Publishing website.

How to do it...

We will take the base blendfile and create a new material that will simulate gray sandstone. So, open up the saved pebble-00.blend file, or one downloaded earlier.

  1. With the pebble mesh selected, select the Materials button from the Properties tab.

  2. On the Materials properties editor panel click the + button to create a new material. Name this Surface-Color.

  3. Change the Diffuse color to a lighter gray. If you click on the color box, a color selector appears where you can change the R(ed), G(reen), and B(lue) values to specific settings. Use 0.750 for R, G, and B.

  4. You can also change the color value by H(ue), S(aturation), and V(alue) as well as Hex values. You can, of course, judge the color, saturation, and lightness by directly manipulating the color wheel marker and lightness slider with the mouse. Change the Specular settings to type Wardiso, Intensity value to 0.411, and Slope to 0.400.

The Wardiso specular setting allows finer control over the specular light across a surface. It suits the spread of specular light found on dry pebble surfaces. You will find that all the specular and diffuse shading methods have different characteristics that may be suited to specific surface types. Experiment to find out their benefits as well as drawbacks.

All that we have done here is create the basic surface properties of color and specularity. To make the material more believable it is necessary to add textures to give variety to the surface color, bumpiness, and specularity. Save your work at this stage, naming the file pebble-01.blend.

  1. Select the Texture panel.

  2. Add a new Texture (the + button) of type Clouds, and name the texture Clouds.

  3. Under the Clouds settings make sure that Grayscale and Soft are selected and alter the Size to 0.05 and Depth to 5.

  4. Under Influence/diffuse settings select Color and set to 0.686.

  5. Select Intensity under Specular and set its value to -1.000.

  6. Also select Normal under Geometry and set its value to 0.500.

  7. In the Blend settings change the blend type to Mix and in the color selector create a darker gray than the base color by changing each of the RGB sliders to 0.46. Alter the DVar value to 0.484.

  8. Finally, check the Old Bump Mapping checkbox to make sure we are using the original Blender Normal method.

    Note

    Blender 2.5 comes with an improved Normal method but you can still employ the older method if that suits the material. Basically, the newer method provides a more detailed bump from a grayscale texture. However, the Blender old, or original, method, is more subtle and ideal for this recipe. We will meet the newer method later in this chapter.

    We have produced a varied gray stone-like surface with a few bumps and a slight specular reflection across the surface, indicating that the pebble has reflective crystals embedded in its surface. Now let's add some surface wear to indicate damage as the sea water bashes the pebble about. Once again, save the blendfile, incrementing the filename, to pebble-02.blend.

  9. Create a new texture of Type Distorted Noise. Name it DistNoise.

  10. In the Distorted Noise settings tab set Distortion to 1.00 and Size to 0.25.

  11. Under Influence/Geometry select Warp and set to 0.040. This should be the only setting selected under Diffuse, Shading, Specular, or Geometry.

  12. Ensure that RGB to Intensity, Negative, and Stencil are selected.

    The stencil setting will not visibly change the surface but it will affect the texture that follows.

  13. Create a new texture of Type Musgrave, and name it Musgrave.

  14. Under the Musgrave tab set Dimension to 0.441, Lacunarity to 2.00, Octaves to 6.358, and Intensity to 1.660. Also set the Size to 0.64.

  15. In the Colors tab Adjust the Brightness to 0.411 and the Contrast to 2.469.

  16. In the Influence tab select Color and set to 0.191. Then under Geometry select the Normal setting it to -1.00.

  17. Set the Blend type to Mix and from the color selector create a darker gray with values RGB of 0.14. Check the Old Bump Mapping checkbox as we will be using the original Blender Normal method for this texture.

Save your work as pebble-03.blend before rendering an image of your gray sandstone pebble. Regularly saving as you progress through any project will mean you can at least recover back to the last save.

What you have produced is a good approximation of a gray sandstone pebble surface.

How it works

In the Blender Material panel you are apparently only offered three color settings; Diffuse, Specular, and Mirror. These set the overall color for each surface property. However, the parameters of each type of shader, Diffuse, Specular, and Mirror can radically alter the way the shader reacts to light and displays the surface. In our case we have set a gray color for the diffuse setting, and a simple white color for specularity. However, we have altered the specular shader to Wardiso, which offers a wider degree of light spread via its Slope setting. In fact, we have set it to 0.400, which will give the widest specular spread using Wardiso. The color settings for specular and mirror can be altered to any color. However, in the majority of cases they can be left at the default white setting as in the pebble example.

To add variety to the diffuse color we need a texture mixed in some way to simulate the surface color variations. Blender allows a large number of textures to be added to a material. The total number seems to increase each year. However, I have never needed to use any more than 16 textures in any material that I have ever produced. Learning how to economically apply textures is a skill that can only improve with practice but try to keep it down to a more manageable number. Your material solution will be much clearer when you view it, maybe several months later.

When you add a texture to a material try to name it immediately. The defaults Tex.001, Tex.002, etc will become confusing, especially if you have to create your material over several days.

In our case we added a texture of type Clouds. There are many other texture types available, ranging from procedural, mathematically produced random types, through to images, such as photographs or drawn images. All Blender textures have settings to alter their properties, such as color and scale, as well as how the texture will be mapped to a material, and what influence it will have.

Procedural textures are mostly grayscale but can be applied via Mix, Add, Multiply, Screen, etc to alter the underlying material colors. These blend types work in a similar way to those found in paint packages, such as Gimp . In this pebble recipe we have used relatively simple mix methods to simulate a complex surface. Later recipes will show the effect of the other blend types available.

In this recipe we have used a number of textures to vary the color across the surface, as well as altering both the bumpiness (the normal) and specularity. Employing textures to add these variations is the way complex surfaces can be synthesized in Blender. We have used a variety of procedural textures to affect color, specularity, and normal. In fact, the first texture, Clouds, affects all three of these settings. Blender allows you to use any texture to change these and other settings with values that are controllable for each influence you wish to use. Here we used the Clouds texture to alter the color, specularity, and bump of the pebble material. However, the second texture, DistNoise, does not affect any of the influence settings of the material; its only task is to warp the texture that follows it. Using a texture to do this is a great way of changing the appearance of a procedural texture. The variation avoids repetition in the surface, which can be a problem if you employ procedural textures many times in a scene. Here it is used in a subtle way with a low Warp setting of 0.040. Another important setting here is the RGB to Intensity from the Influence tab. This will ignore the color values of the texture, which are not needed when applied to several of the influence types. In our case the Distorted Noise texture is grayscale anyway, but getting into the habit of checking this setting will avoid problems when using a color texture for such influence examples.

We also set Stencil in the Influence tab. This fascinating setting uses the texture to mask following textures. We can use it to allow the following textures to affect the surface (any white areas of the texture), partially affect the surface (any gray areas of the texture), or obscure following textures surface influences (any black areas of the texture). We can reverse that effect by selecting the Negative setting above it. Masking is one of the fundamental techniques to create a good texture. The stencil setting is extremely effective at giving that facility. However, it will only work with grayscale textures or with the RGB to Intensity set.

The third texture, Musgrave, adds further levels of color and bump variation. In the Musgrave tab we have altered the settings to produce distinct bump maps to create the kind of dents found when pebbles crash in the surf. Having several textures affecting the normal of a surface means we can simulate complex bump structures using simple procedural textures. By varying the contrast of a texture, we can limit and increase the edge detail of a bump quite simply. Here we did not set the RGB to Intensity under the Influence tab as the texture is already grayscale. If you want, set that now and render again and see if there is any difference.

Exploring the settings for any texture can be one of the most creative and stimulating exercises in 3D design. Finding the right settings will become easier as you explore Blender but experimenting as the accidental breakthrough may be the answer to your next material simulation.