From BlenderWiki

Jump to: navigation, search

Exercise 2

Blender materials and textures have all the tools necessary for you to create wood, metal, plastics and many other natural and industrial material types. However, Blender is an animation suite. It not only allows one to design fantastic quality still images; it also allows you to animate them to full cinematic quality. Of course the jump from being able to create a simple material and texture to a full ‘Elephants Dream’ might seem a very long journey. However, once you have grasped the fundamentals of the process you will be able to create anything.

So now is the time to move up a notch and see if it’s possible for Blender to simulate the materials and textures for a much larger vision. Something that most of us may never have directly observed. A scene so grand it might have been designed for a blockbuster.

The Waterfall

BSOD-Materials-Textures-waterfall.jpg


NOTE:

This exercise requires a quite high calibre system. The files supplied are over 1Mb in size therefore it might be an idea to load up the finished waterfall blend file Media: waterfall-01.blend and see if your system will render OK.

Here are some other useful notes:-

  1. If you have a very low specification system you can still undertake the example exercises but use them on simpler meshes to help you learn about the material settings.
  2. If you can load the example file but still have a relatively low specification system only render to smaller sized screens. For instance 25% of HD is 480 x 270 which is still adequate to see the effect.
  3. Finally you can render an animation from this exercise but be warned that 200 frames will take many hours to render. If you have a low spec system it might be best to render 50 to 60 frames which is still 2 seconds of viewable animation.

This imaginary scene was designed to cover many of the remaining areas of Materials and Textures in Blender:-

  • Shader Types
  • Procedural textures
    • & their noise values
  • Texture blend modes
  • Mapping techniques
  • Strand shading (grass and hair)
  • Halos for mist and special effects

However, that will still leave some specifics, like toon shading, that I also need to cover. So I intend to pause occasionally during the waterfall exercise and introduce these other useful techniques.

  • Toon shading
  • Repeating textures without producing patterns
  • Animating a texture
  • and many other things on the way.

Once we have completed the waterfall you will be able to make a few simple changes to the materials, to transform our Waterfall to a Lavafall worthy of a space opera setting.


BSOD-Materials-Textures-lavafall.jpg




Waterfall

As you can see from the example render the waterfall contains several materials and textures. We have a rock texture that attempts to simulate a cracked and layered rock deposited many millions of years ago and its surface worn by wind, rain and earthquake. We have grass and plants that now grow through the surface of the rock. We have the water itself that flows down the rock gorge to plummet into the valley below. Each of these textures has been created with inbuilt procedural textures.

Working out a strategy for the creation of a material simulation follows exactly the same process outlined in the desktop example.

  1. Diffuse shading
  2. Specular shading
  3. Bumps and variation across the surface
  4. Reflection (if any)
  5. Adding history to the material (Dirt and Grime)

Let’s look at that for the rock material.

The Rocks

Before we focus on this material in detail download the blend file Media: waterfall-01.blend

The file will open showing a very grey scene because a material has yet to be assigned. The background rock mesh is selected and the Materials button should be selected ready for you to apply your artistic material creations.

NOTE:

Remember that F5 will bring up the material button for the selected object if it’s not there already.
In fact if you keep pressing F5 it will cycle through the available materials and texture buttons i.e. Material, Texture, Radiosity, World and Lamp Buttons.

BSOD-Materials-Texture-buttons2.jpg


  • LMB Template-LMB.png the Add New to create a new material to work on

In terms of diffuse shading of the rock we have to choose a material color and a model of shading that will look like rock rather than plastic. In order to understand this it might be a good idea if I explain the various diffuse and specular models available in Blender.

Intro to shader types

The best one for the job?

  • Examine the Shaders tab in the Material button.

There appear to be a bewildering array of both diffuse and specular shading models. All of them have strange names which on first reading convinces you that they were created by some ancient alchemist with the inner knowledge of the Diffusee Code.

Don’t worry the majority of the diffuse and specular shaders can create very similar results by tweaking the settings. Indeed up until recently Blender only used one diffuse shader model Lambert which is named after a 18th century mathematician who devised a simple equation to describe how light is reflected from a surface. The other more recent shaders are named after their creators and are commonly used in 3D packages.

If one can create similar results from these shaders; why have more than one? Well, each has varying controls which make it easier to produce certain effects using one rather than another. You can read further about them here:-

http://mediawiki.blender.org/index.php/Manual/PartIII/Diffuse_Shaders

Here is my biased interpretation of their possible uses.

Diffuse shaders


BSOD-Materials-Textures-shaders1.jpg
  • Lambert – The simplest shader with only one setting: the reflection from the surface. Learn to use this type of diffuse shader and you can create almost any material.



BSOD-Materials-Textures-shaders2.jpg
  • Oren Nayar – This is a more physical model and has adjustments for roughness of the surface. This is useful for materials that have a rougher or drier surface, like rocks. Just to show I know some stuff the Oren-Nayar reflectance model was proposed by Michael Oren and Shree Nayar of Columbia University in 1994. (NO MORE SHOWING OFF)



BSOD-Materials-Textures-shaders3.jpg
  • Minnaert – This is based on the Lambert model but can darken or lighten the edges facing away from the camera using the dark setting. Lower values produce a lighter edge; higher values produce a darker one. It can be used for any material but cloth or metals can look good with this diffuse shader.



BSOD-Materials-Textures-shaders4.jpg
  • Toon and Fresnel (as special diffuse shaders) – These shaders are for special effects. The Toon shader is not a physical shading model but is designed to give a graphic or cartoony effect. I have a special example of this later in this section.


BSOD-Materials-Textures-shaders5.jpg
  • Fresnel is a new diffuse shader that reflects lighter at the edges based on the direction of the light source it’s reflecting. As this is an entirely new diffuse model time will tell what types of material it can help simulate.



Specular shaders


BSOD-Materials-Textures-shaders1.jpg
  • Cook Torr – This is the default specular shader when you first download Blender. It produces a good specular highlight with only 2 settings, Size and Hard(ness).



BSOD-Materials-Textures-shaders7.jpg
  • Blinn – This is a phong (see next) based specular shader with 3 controls, Spec, Hard, and Refr(action). It gives a little more control over how the specular highlights look. You will find this useful with all kinds of material.



BSOD-Materials-Textures-shaders6.jpg
  • Phong – Is a standard specular shader found in many 3D packages. It can produce good specular highlights particularly for plastic like materials. It has 2 settings, Spec and Hard.



BSOD-Materials-Textures-shaders8.jpg
  • Toon (as special specularity shader) Great for those graphic cartoon look highlights. I will show you this later.



1BSOD-Materials-Textures-shaders9.jpg
  • Wardiso – This specular shader gives good control over how sharp the specular highlight is. It has 2 settings, Spec, and rms (root mean square, for you maths geeks). It can be useful for almost any material where you might need to tighten the specular highlight.



The Diffuse Color and Shading Model

I don’t have a real reference for a rock type that might exist near a waterfall. Nor can I easily visit Niagara or Angel falls. I’m left with using my imagination to come up with the settings for this rock material. I can always use the internet to find images of such places. It can help however, if you work out a design card for the objects you are trying to create.

Design Card

This can contain photographs taken by you, or cut from magazines together with written descriptions of exactly what the material is made from. You could even do some drawing or paintings of the shapes or colors of what it is you are trying to make. Keep that design card near you when working in Blender so that you can refer to it and make the material creation less of a hit and miss affair.

I started with a written description of a few lines that described the kind of rock I was after. I also collected a few internet images to help in the process.

NOTE
Even internet images are somebody’s copyright so don’t pinch them for materials. However, I can see no harm in using them to inspire you.


Rock Color

BSOD-materials-Textures-rock1.jpg


Here I have set a simple blue grey color for diffuse. I arrived at that color after looking at old volcanic rock from an image. Now let’s set the shading model for both Diffuse and Specular.

BSOD-materials-Textures-rock2.jpg


Diffuse

I have chosen the Oren-Nayar diffuse shader because it has the roughness setting which is ideal for this rather dull type of rock. However, you will notice that the Ref(lection) has been set higher than the default to make sure it doesn’t appear too dark in our renders.

Specular

For the specular model I have chosen WardIso which although more normally used for tight specular highlights is used here with no Spec and a low rms value. This gives a very low specularity in its default settings but later we will apply a special map that will mark those areas of the rock that are wet from the water.

Rock texture

Rock is definitely one type of material that requires texture to make it look real. So let’s do that now.

  • Switch to Texture Button F6
  • Select the first slot and create a Cloud texture with the following settings:-
1BSOD-materials-Textures-rock3.jpg


NoiseSize: 0.130

NoiseDepth: 2

The preview will give some idea of how the texture will appear.

As we found out during our desktop exercise textures have to be mapped:-

  1. Scaled and Oriented - Map Input and
  2. What property of the material they will affect – Map To

So from the Material button select those 2 tabs.


BSOD-materials-Textures-rock4.jpg

Map Input

As you can see the cloud texture is mapped as Cube which means it will appear equally around all sides of the rock. I could have set this to Flat as procedural textures are not one dimensional. However, for completeness I like setting these things so they make sense.

Map To

The Map To settings are for both color and Nor (or bump). The color is a nice brownie grey and this is Add(ed) to the underlying diffuse color.

The Nor value is quite high at 7.89. Rocks tend to have large cracks and dents compared to manufactured items. However, this could lead to artefacts although as several other textures are to be set above this one I don’t think they will show.

Notice I have also set the Warp on and a small value set 0.01. This will slightly warp textures in higher slots

Note the preview pane of the material button.

BSOD-materials-Textures-rock5.jpg


You might want to set a preview screen inside the camera view to give you a larger preview as you work on any of these materials


BSOD-materials-Textures-rock6.jpg


This texture has been added to the diffuse color. Blender offers many more blend options than Mix or Add. Here is a list of the normal texture blend modes.


Blending Modes

BSOD-Materials-Textures-text-slots.jpg

Textures use blend modes which are similar to those used in paint packages with layers. The blend will describe how the new texture will be applied either to the underlying color or to the previous texture. The first texture slot is known as slot 0 and each subsequent slot increments by one.

So if we assume that slot 0 contains this image
And the next texture position, slot 1, contains a diagonal blend image



Then the second image will affect the first in different ways depending on the blend method chosen in its Map To tab.

BSOD-Materials-Textures-mapto-blends.jpg


Here are the blend methods and their effect.


Mix

BSoD-Materials-Textures-blendmodes-mix.jpg

Mix is the default blend method and any layer above the base layer with mix as the blend mode will dominate the picture, as you see here you cannot see the picture below.


Add

BsoD-Materials-Textures-blendmodes-add.jpg

The two layers are added together. Black areas of the blend layer have no effect. The light areas add to the lightness of the underlying image which become much brighter.


Subtract

BsoD-Materials-Textures-blendmodes-subtract.jpg

The opposite of Add. The white areas become very dark and the black have no effect.


Multiply

BsoD-Materials-Textures-blendmodes-multiply.jpg

Black areas of the blend darken the underlying image whereas white areas have no effect.


Screen

BsoD-Materials-Textures-blendmodes-screen.jpg

The black areas of the blend become transparent, the white areas are opaque.


Overlay

BsoD-Materials-Textures-blendmodes-overlay.jpg

This new blend mode was primarily developed for the new Node Materials. It offers a combination of screen and multiply, which darkens dark areas, and brightens bright areas.

Currently it has no effect in the blend mode of normal materials.


Difference

BSoD-Materials-Textures-blendmodes-difference.jpg

White areas of the blend layer will negative the image below. Black areas of the blend have no effect.


Divide

BSoD-Materials-Textures-blendmodes-divide.jpg

The opposite of multiply. So black areas of the blend layer lighten the underlying image white areas do nothing.


Darken

BSoD-Materials-Textures-blendmodes-darken.jpg

The underlying layer is only dominant where the blend layer is lighter. The Blend dark areas become dominant otherwise.


Lighten

BSoD-Materials-Textures-blendmodes-lighten.jpg

The opposite of darken. Lighter areas of the blend layer become more dominant; darker areas the underlying layer become more dominant.


When you progress onto node materials you will find even more blend modes available to you.


Ideal Rock textures in Blender

OK time to create some more textures to make our rock texture rock. Blender offers many procedural textures. Each probably has a limitless range of possibilities in terms of what it can do for your material. However, there is one texture above all others that works great with rocks.

Musgrave

This procedural can produce some lovely cracks and deep dents on surfaces. It’s very random just like in the real world and quite easy to apply.

Rather than create this texture in the next slot down I want you to leave a gap as I know we will need a special texture in the slot after the first to correctly set a specularity map.

After creating materials a few times you will learn through experience about texture ordering so that it becomes second nature. We could have moved textures around as you learnt in the first exercise but I want to save you some time.

So select the empty texture slot 2 and create a Musgrave texture using the settings shown.

BSOD-materials-Textures-rock7.jpg


Map as follows in the Material button.

BSOD-materials-Textures-rock8.jpg


So the size has been changed and the Nor value set very high. This will produce some very deep fissures in our rock surface.

Adding History

Currently we have a rock surface that looks like a well smoothed, but large pebble. In order to make the material look more like million year old rock we need to add history to it.

Let’s examine what that might be for rock.

Rock Characteristics

  1. Rock is often deposited in layers either following eruption at different periods of its history or as a result of silt or dust settling and being compressed over time.
  2. Rock layers are often distorted by earthquakes and plate movement which can twist the layers in all kinds of direction.
  3. Rock is acted on by water, ice, wind, gravity etc. Eventually bits will fall off and areas will become unstable leading to large and random cracks usually aligned to the layer structure of the rock.
  4. Rock that is deposited can often have different chemical properties that can alter the color, composition and other visible property.

So is there a procedural texture that might give some of these properties?

Procedural types


  • Distorted noise
    BSoD-Materials-Textures-dist-noise.jpg

This procedural looks like crumpled material or with different color settings can look like flames. It’s a multi purpose procedural with lots of application many of which you will develop as you become a Blender maestro.


  • Voronoi
    BSoD-Materials-Textures-voronoi.jpg

This procedural has a nice cell like quality although through its settings it can be used to create anything from bubbles to stained-glass windows.


  • Musgrave
    BSoD-Materials-Textures-musgrave.jpg

A Fantastic noise type procedural that works great with rock materials and also for such things as rust damage.


  • (Plugin)

Blender has the ability to use additional plugins created by the community. There are sites out there with some exciting new textures. Use search in one of the Blender community forums or use Google.


  • Noise
    BSoD-Materials-Textures-noise.jpg

As its name suggests this procedural is a simple noise. It actually has no settings and as such is probably only of use to add noise to a surface or other texture. However, please prove me wrong by creating some fantastic material with this texture.


  • Blend
    BSoD-Materials-Textures-blend.jpg

This texture has a series of blends from white to black. Again it is useful to help mask or stencil portions of a material as we have used already. The colour can be changed and it’s also possible to tighten and move the transition of colors. Indeed if you look at my Toon shading example it’s actually been used to create stripes on a flag. This is a very versatile procedural with lots of uses.


  • Magic
    BSoD-Materials-Textures-magic.jpg

A weird pattern like procedural that looks a little like fabric weave.


  • Wood
    BSoD-Materials-Textures-wood.jpg

As its name suggests it is great for producing wood.


  • Stucci
    BSoD-Materials-Textures-stucci.jpg

This texture can for instance produce nice wave like dents on the surface of water. It could also be used to add flecks to a surface. However, it only affects level and therefore can’t be used as a color texture. But as a bump map its great.


  • Marble
    BSoD-Materials-Textures-marble.jpg

Rock like strata that mimics marble and a range of other layered rock.


  • Clouds
    BSoD-Materials-Textures-clouds.jpg

Possibly the most useful procedural texture in the Blender suite. It can add great random variation to any surface. It can generate clouds and mist. It can be used to simulate fire and smoke. Hey I’d be married to this procedural if I wasn’t married already.


  • (EnvMap)

This is a special map type that collects a mirrored cube around the object it is mapped to and maps it back to the object thus producing a mirrored surface.

As explained in the first exercise there are easier, and more accurate, methods of producing reflections using Raytrace. However, it’s available for you to explore.

http://mediawiki.blender.org/index.php/Manual/PartIV/Environment_Maps


  • Image

Guess what.


By your legendary powers of deduction you have already worked out which procedural can be used to create the rock layers as described earlier.

Marble

In the next available texture slot create a marble texture with the following settings.

BSOD-materials-Textures-rock9.jpg

Sharper
Soft noise and
Saw
Noise Size: 0.464
NoiseDepth: 6
Turbulence: 4.45
Noise Basis Voronoi Crackle

Noise Basis

Many of the Blender procedurals have the Noise Basis rollout.

BSOD-materials-Textures-rock10.jpg


Offering a vast array of options for altering the way a procedural will be generated. You should think of these as a paint pallet, or box, and experiment to find out what will work with your material creations. Although you may occasionally choose the wrong one for what you are trying to create you may discover a brilliant new combination that might work wonders with your next material.

Color Your Procedural

Comparing your texture with the one shown above in the Preview Tab will show that your material is black and white whereas mine is colored.

Although it’s possible to create a single color, for procedurals, in the Map To Tab of the Material button. It’s possible to create widely varying and multi-colored procedurals from within the Texture Buttons.

Color

BSOD-materials-Textures-rock11.jpg


The Colors tab allows us to vary the Bright(ness) and Contr(ast) of the procedural. It also allows one to change the overall color. But it’s most useful feature is it’s ability to have a Colorband set that will have varying levels of color and alpha along the procedural shape. In our case it has color positions shown by the vertical white and black markers in the colorband.

When you first turn colorband on it will have 2 markers at opposite ends of the band. One white at full visibility A(lpha) 1.000 and one black and transparent A(lpha) 0.000. Further markers can be added by either LMB Template-LMB.png the Add button above the colorband. This produces a grey marker in the middle which you must drag if needed elsewhere on the band, or by holding the Ctrl and pointing with the mouse cursor and LMB Template-LMB.png to place a marker at that location. You can of course alter both the color and alpha of the selected marker by altering the appropriate values.

This is a truly useful facility and some fantastic effects can be generated using colorband.

Time for an exercise to give you practice with colorbands.


EXERCISE

There are 5 markers in the colorband above. Each has different positions colors and alpha. I want you to create them based on the value settings below.

You can loosely position the markers by pointing and holding Ctrl and LMB Template-LMB.png. Then after setting the color and alpha you can accurately position them by using the Pos entry below the colorband;. You can check each one by using the Cur(rent) left and right clickable arrows which will display the settings for each selected marker.

BSOD-materials-Textures-rock12.jpg



Map Input

Here are the settings for the Map Input, in the Material button, for the marble texture.

BSOD-materials-Textures-rock13.jpg

In order to get the layered rock, or marble texture, to run in the right direction it was necessary to alter both the scale and orientation of the texture. I arrived at those settings following a little experimentation.

Map To

BSOD-materials-Textures-rock14.jpg

This is a simple Col(or) and Nor(mal) mapping mixed so that the colors from the colorband will dominate the underlying color. Remember that most of the color band had its alpha set to 0.000 so it’s only where the sulphur colored edges of the cracks where it will take over from the underlying color.

If you were to render now this is the effect.

RENDER

BSOD-materials-Textures-rockrend1.jpg


Not bad. I can almost smell the fresh breeze wafting down this gorge. However, I said that the rock needs a special specularity map to show where the water of the river splashes on its sides. To see where that should be select layers 1 and 3 and render once more.

BSOD-materials-Textures-rockrend2.jpg


OK I am cheating for you a bit here because the waterfall already has a texture applied. After we finish the rock we will not be going over each texture but rather highlighting any notable material or texture technique.


Specular Maps

We have seen how a texture can affect color and bump. With our desktop exercise we used an image to apply both color and specularity. Such maps are very useful in 3D modelling because few real materials have constant or even specularity. Look at your face in the mirror and you should see that the specularity varies quite widely across its surface. Specular maps usually need to be created in a paint package but they don’t have to be large or accurate for our purposes.

NOTE
Just looked into a mirror. That's another seven years bad luck:)


Wet-map.jpg

Save this image to your Blender directory.
This map is only 488 x 221 pixels in size. Let’s add it to our rock material.

BSOD-materials-Textures-rock15.jpg
  • Select the background rock and turn off the layer 3 so that only layer 1 is active.
  • Select the Texture Button for the rock material and choose the spare 2nd slot which we left blank earlier.
  • Select Image as the texture type and load up the wet-map.jpg image from the location you saved it to.


BSOD-materials-Textures-rock16.jpg

The various settings at the top of the Image tab allow one to filter or simply orient the image. MipMap and Interpol(ate) are defaults Rot9(0) will as its name suggests rotate the image clockwise through 90º . Most of the others have special functions which in the majority of circumstances are seldom required. However, if you want to learn more go here:-

http://mediawiki.blender.org/index.php/Manual/PartIV/Image_Textures

Filter

The Filter setting is useful occasionally because it gives the ability to blur the image slightly. The default value is 1.000 but as you can see I have set it to 2.000. This is because the image is rather small yet it will be mapped quite large onto the face of the rock. To avoid pixilation becoming too obvious setting the filter value to 2.000 has slightly defocused it thus masking any pixilation.

Extend

The Extend, Clip, Clip Cube, Repeat and Checker commands express how the image will deal with areas outside of the image. Clip will stop any edge pixels spilling to the rest of the material. Extend will do the opposite. As the image has white pixels on its base and left side setting extend will ensure that its edges will not become visible in shot as those edge pixels will spread out from the image.

Mapping this specular map

BSOD-materials-Textures-rock17.jpg

As you can see the X,Y,Z position has been changed to get the image to Map Input to the correct location.

The Map To settings is for Col(or), Spec(ularity), and Hard(ness).
The Col setting can only be on or off but many of the other settings such as Spec are like three-phase switches i.e. They can be off, on, or reversed.

Here they are all just ON.

By setting the No RGB to on, only the color in this tab will be applied by the Col setting. A dark green has been set as the color.
I have also set the Var(iance) setting to a lower value. This setting controls how much of the texture will affect the other settings.

  • Set these on your material and then do a quick render.



Render


BSOD-materials-Textures-rockrend3.jpg


The rock material is now completed. It provides a reasonable simulation based on those criteria that were identified before we began the material shading process. However, when we use procedural or image textures as creatively as here we may produce other problems that will need dealing with.

On the top rock surface the bands of the marble material repeat rather unnaturally. Repeating patterns can be a really tricky thing to deal with in any material. It becomes even more of a problem when we use photographic images repeated over a material surface. So learning how to deal with such things is an important skill.


Repeated patterns and how to avoid them

Take a look at the image below. This is a classic brick image that could be used as a color and bump map to create a wall of any size.

Repeat-brick.jpg


Unfortunately using cameras to take photos for repeat mapping will always lead to some distortion. Barrel and perspective distortion can now be reduced in any reasonable paint package but at the end of the day where the seams meet you will get repeating patterns.

BSOD-Materials-textures-repeat1.jpg


Strategies for dealing with seams and repeat patterns

There are basically 5 ways in which one can deal with seams and repeat patterns.

  1. Scale the repeats so it’s less obvious.
  2. Cover them up, or move them to a less obvious area of a render
  3. Mask them with another non repeated texture.
  4. Light them with a gobo to distract the eye from a seam or repeat.
  5. Create a perfect tileable textures.



Scaling to avoid repeats

This is probably the easiest method of reducing any seams, or repeat patterns, just don’t repeat as often. Even procedural texture can show nasty repeat patterns when mapped as mist or particles. Playing with the image scale can sometimes reduce the obvious repeats.

BSOD-Materials-textures-seams1.jpg



Covering up the seam

Again a nice easy solution is to place something in front of any seams.

BSOD-Materials-textures-seams2.jpg

Here a mock wall light with a down pipe both breaks the seam above the light and the illumination itself helps break any repeat pattern.


Mask with another non-repeating texture

It’s easy to create a new texture layer with a Blender procedural to mask out repeats.

BSOD-Materials-textures-seams3.jpg



Light the with a gobo

A gobo is a texture mask placed in front of a light source so that it projects a mock shadow onto a surface.

BSOD-Materials-Textures-leaf-gobo.jpg
BSOD-Materials-textures-seams4.jpg

You can apply textures to lights in Blender. Spotlights in particular. It is a quick and easy trick to add scene detail without the hassle of using large meshes. Here it’s used to cast a shadow on the brick wall that helps cover any seams or repeats.





Back to the Waterfall


I told you earlier that materials have already been created for each of the objects in the scene. However, currently only the rock material, you created and the waterfall itself, have the materials assigned. Blender allows one to create materials, without owners, that are saved with the blendfile. Normally textures not used are discarded when you save the file.

BSOD-Materials-Textures-Links1.jpg

After you have created a texture you can fix it into the blendfile by pressing the F button on the Links & Pipeline tab of the Material button. As soon as you do this the material count will increment by one to show the number of times it is used in the scene.

Applying pre-created materials to objects

If you haven’t done so yet load up the waterfall blendfile and select layer 2 to display the foreground rock, and the grass and flowers meshes.

BSOD-Materials-Textures-wf-2-1.jpg


  • Select the foreground rock. You can confirm this because I have named each mesh meaningfully and that name will appear as shown in the image.
BSOD-Materials-Textures-wf-2-2.jpg


  • From the Material button LMB Template-LMB.png the scroll arrows by the Add New button in the Links & Pipeline Tab.
BSOD-Materials-Textures-wf-2-3.jpg


A list of all available materials, with a small thumbnail of the texture, will appear from which you can select one of the textures to be used by the object.

2BSOD-Materials-Textures-Links2.jpg
  • Select foreground-rock.

That material is now assigned to the selected object. You will also notice that the number of users has incremented to 2.

Materials can be shared between any number of objects. However, making changes to the material will affect all objects that the material is assigned to.

Quite often it’s necessary to make an independent copy of a material for small changes on an individual object. Here I could have applied the same material rock to both the foreground and background rock faces. However, I didn’t want to have the specular map texture applied to the foreground rock. So I first added the rock material to the near rock face then LMB Template-LMB.png the 2 count in the Links & Pipeline tab and selected the make single user.


BSOD-Materials-Textures-Links1.jpg



Exercise

OK time for another exercise. Select each mesh in this layer and apply the appropriate material.

  • Select layer 4 and do the same for that object.

Be warned that layers 3 and 4 contain lattices that are used to distort those meshes. When you select them ensure that it is the mesh and not the lattice you try to add the material to.

  • Save your work so far.

Let's take another pause to look at a special material shader type.


Toon Shading

Toon shading gives you the ability to create materials with a cartoon or graphic look. Of course using this mode of shading will unsurprisingly create a non-photoreal image. The quest for photo reality in 3D design is a worthy aim but as with any artistic medium we don’t have to be confined to a single genre.

Blender offers a very usable Toon shading model complete with the ability to add ink like outlines in the renderer. One would think that using such a simplified shading method would be easier than conventional shading models. However, Toon shading requires careful setting to get the result to look right.


BSOD-Materials-Textures toon-flag2.jpg


As an example I have created a demo blendfile of 3 flags flapping in the wind.

Download the file Media: BSOD-flag.blend

In terms of Toon shading the important points of this example are that the illuminated portion of the flag has an abrupt change to shadow just like one would see in a cartoon. This was achieved using the Toon diffuse and specular Shaders in Blender.

Displacement

I have also used a procedural texture to apply the wind motion to the flag by using it as a displacement map. This is where a texture will modify the mesh upon which it is placed only at the time of render. The advantage of this is that one can animate the texture and thus deform the underlying mesh over time. I have also used a simple Blend texture to limit that displacement near the pole making it look as though the flag is actually connected to it.

Having a mesh that will show the Toon effect at its best is almost as important as the Shaders that are used. Flat meshes like planes and cubes will not look as good as spheres and objects with curved surfaces. In the example the flags are planes but they have been subdivided many times to produce a smoothed mesh that’s ideal for displacing.

BSoD-Materials-Textures-toon-mesh1.jpg


If you want to know more on mesh creation or editing read:-

http://mediawiki.blender.org/index.php/BSoD/Introduction_to_Modeling or

http://mediawiki.blender.org/index.php/Manual/PartII

Let’s examine the texture in detail.

If you are not already there select one of the flags and switch to the Material Button. By the way all three flags share the same flag material. This might not be apparent to you because although they have the same light blue line graphic each looks different because of the displacement which is not the same on each flag. I have used an interesting technique to achieve this that was only discovered while creating the tutorial. All will be revealed as you read further.

BSOD-Materials-Textures-flagmat1.jpg


These are all of the general settings for the flag material. You will probably notice that all of the settings for colors are at there default. This flag gets its color from the flag pattern which is given by the first texture slot.

Toon Shader Settings

Both the diffuse and specular shader use the Toon type which has very similar settings:-

Diffuse

  • Ref is the amount of defuse reflected light from the material. Here it’s set to 0.80 which is the default.
  • Size: is a setting that controls how far around the material the defuse light will travel before it changes into shadow.
  • Smooth is the sharpness of the transition from diffuse to shadow 0 = sharp to 1.0 which is smooth.

Specular

  • Spec is the amount of specular light
  • Size controls the how far around the material a specular highlight will show
  • Smooth specifies the sharpness from specular light to diffuse. 0=sharp to 1.0 which is smooth.

You might have to do a little fiddling with the size to obtain the cartoon look you are after. In my example I have set it so that the shape of transition between diffuse and specular light and shadow is very sharp and simple.

BSOD-Materials-Textures-flagmat1a.jpg


The Textures used

I have used 4 textures.

0 Blend-strips – which gives the blue stripes color to the flag.

This is a Lin blend color band texture which rather than gently blending between 2 colors has a number of markers close to each other that change from white to blue to produce sharp stripes. I could have used an ordinary image file of a flag pattern but I wanted to show how color band can be used beyond its gentle blending of color.

It’s had Flip XY set in the Blend tab so that the stripes run down the flag rather than across it.

BSOD-Materials-Textures-flagtex1.jpg


This is applied a Col in the Map To tab with just standard settings.

1 mask – which is also a Lin blend texture from white to black. Only the standard settings are used with this texture.


BSOD-Materials-Textures-flagtex2.jpg


In the Map To tab of the material it is applied only as a stencil. That means it will not be displayed but the stencil will have an effect on all textures that follow it.

BSOD-Materials-Textures-flagtex3.jpg


I have also set No RGB this ensures that only the value is being used by the Stencil i.e. it ignores any color information in the texture.

2 wave2 – This is a marble texture with some modest settings to produce a wavy map.

BSOD-Materials-Textures-flagtex4.jpg


This is Map To as a simple displacement.


BSOD-Materials-Textures-flagtex5.jpg


Again No RGB is set to only use the levels.

Disp(lacement) is set at 0.40 which is quite low. Also no Nor has been set with displacement. This is because both of these settings affect each other and if you’re not careful Disp will distort the mesh too much and you will get artefacts in the displaced mesh.

NOTE:
I have also set Warp on with a very small setting 0.05. As described earlier this will warp textures that follow.


3 wave1 – This is a simple wood texture again with modest settings.

BSOD-Materials-Textures-flagtex6.jpg


The Map To settings for this texture are similar to the last.

A Disp setting of 0.300 which is slightly lower. This is because any displacement will be add(ed) to any previous displacement thus increasing the risk of artefacts. Again No RGB has been set to ensure only levels are used with this texture.

I have also set the Warp on but to 0.00 thus turning it off from this point in the material. That’s just in case I might want to add further textures that I don’t want affected by the previous warp.


BSOD-Materials-Textures-flagtex7.jpg


Textures can be animated

A still picture of a flag is OK but it will really come to life if it’s animated. Blender has a number of ways in which a texture can be made to move over time. IPO curves, that are used for Character animation in Blender, can also be made to work with materials. Indeed I have used that technique in the waterfall to create the foam on the surface of the water.

BSOD-Materials-textures-IPOproced.gif


One of the disadvantages of using IPO animation on procedural textures is that the texture will never loop.

But there are other methods of animating a texture and also getting a looping procedural texture.

Map Input to an Empty

You can not only map to the object ORCO space you can also map to another object. A really useful one is the Empty object. This is created like any other Blender object.

  • Place the cursor where you want it.
  • Press Space and from the Add menu select Empty.

An Empty object appears as a set of axis co-ordinates.

BSOD-Materials-Textures-flagempty1.jpg


Although it does not render it can be animated like any other object, with an IPO. Here it has been made to rotate around its Y axis through 360’ over 200 frames. In other words it will repeat after 200 frames thus producing a loop. The 2 wave textures are mapped via the empty and because of this there size has had to be changed a little to make the scale correct.

BSOD-Materials-Textures-flagtex8.jpg


Now because the two wave textures are all mapped via the Empty the displacement will look slightly different on each flag because procedural textures like marble and wood are 3Dimensional in the way they are mathematically defined. So they vary across each of the axis X, Y and Z.

RENDER an animation

Because this file and its material use very simple materials it can be animated quite quickly at about 2.45 seconds per frame, on my system, at 320 x 240.

Cartoon Shading is great fun and Blender offers some simple to use yet powerful Toon Shaders.

NOTE:
Many traditional animators now use 3D systems to create such difficult to hand animate objects.



Waterfall continued

Although there might not be time to cover every material remaining in the scene you will be given the task of examining those untouched materials, like the waterfall material itself, and finding out how they were achieved.

In fact the waterfall material uses techniques already used with both the desktop exercise and blend methods from this section of the tutorial. However, I would like to describe those material techniques that will be new to you.

Strand Shading

Strand shading is a new method of creating fur or thin stranded items such as grass. The meshes use static particles which although not covered in this tutorial are available via the community.

http://mediawiki.blender.org/index.php/Manual/PartXIII/Particle_Hair

Using these techniques it’s possible to create some truly amazing effects.


A digital Toupee



Tabby Fur
Kong Fur



In our scene we are using it to create grass and long stranded flowers. Incidentally the grass material on the rock at the back is primarily used to mask the repeating marble texture pattern on its top surface. So we are using method 2 for dealing with seams and repeating textures.

Hey, but it looks good and provides a mechanism to describe the strand material.


Creating the Grass

I have already created 4 meshes with static particles on that hold our grass material.

  • Select layer 1 and 2 of waterfall blendfile that you saved last.

You should have already applied the textures as requested.

  • Select the grass-close object and switch to the Material buttons F5
NOTE:
The static particles on this mesh use some advanced features including weight painting for density and distribution of the grass. These are too advanced for this tutorial so I will not attempt to teach them here.


Lets examine the material settings

BSOD-Materials-textures-strands1.jpg

The material color and general settings are quite simple. A dark green color, with moderate specularity, using the default shader models. The magic with strand shading is in the texture that is applied and the way it is mapped to the static particle.

BSOD-Materials-textures-strands2.jpg

A blend texture, with a colorband and varying levels of color and alpha along the blend, is mapped as strand which means it follows the curvature of each blade getting thinner where the alpha is below 1 in the blend texture. For grass it shouldn’t be too thin so none of the alphas along the blend are that low.

BSOD-Materials-textures-strands3.jpg

There is a further useful control of the strands in the Links and Pipeline tab of the Materials button. If you LMB Template-LMB.png the Strands button a set of controllers appear that allow you to set the Start size, End size and Shape of the strands. These are the settings I used for the grass.

BSOD-Materials-textures-strands4.jpg



There are 2 meshes used for these static particle strand materials. The 2nd is called flower-close and if selected the material button will show the flower material.

BSOD-Materials-textures-strands5.jpg

BSOD-Materials-textures-strands6.jpg
This material has a bolder diffuse color with the same default shader models. It also uses one texture that has strand mapping set.

BSOD-Materials-textures-strands7.jpg


The texture has a very bright red color at the tip. Explore the alpha settings within this strand texture.


If you examine the materials for these strand textures between those used, on the close rock and those on the far, you might notice that those close have Ztransp set on the Links and Pipeline tab whereas those in the distance do not. Why is this?

Well Blender (v2.42) now renders layers separately and combines at the end of the render process.

Strand material without Ztransp would have an annoying fringe if not set. However, Mist, which is used in this scene, interferes with the transparency so I have had to turn the Ztransp off for the background grass and flower blend materials. Because they are a long way off you can’t see the fringe on their edges anyway.


NOTE:
Sometimes 3D systems need a little tender love to coax them into producing the effect you want. The important thing is not to loose sleep over these small problems but learn from them.


Talking of mist leads me onto the last new area of materials and textures in Blender

Spray and Mist

In the 4th layer of the waterfall scene is a copy of the waterfall mesh with a special material attached. It uses another useful Blender material shader called Halo.

Halo materials

Halo materials are special in that they are mapped individually to vertices or particles. More often than not they are used with particles to represent such things as sparks or steam or mist, or other magic objects. I have used them here with a mesh to represent the spray from the water.

BSOD-Materials-textures-strands8.jpg

Here I have used a very simple halo setting with no textures. You will notice that when halo is selected from the Links and Pipeline tab the material tab changes to Halo, Line, and Ring color settings.

The Shaders tab has some of the more important settings for Halos.

HaloSize - is quite important because if it’s made too big each halo will dominate the scene. Whereas if it’s set too small the individual particles, or vertices, become very apparent.

Hardness - will set the edge hardness of each halo. Setting this too low will produce circular distinct discs which although unnatural might be of value with a little thought.

Add – defines how each halo will interact with its neighbours. If this is set too high the effect will be bleached out where there are more particles or vertices.


The other settings, which are not used in my example, can add rings and stars and other more advanced effects. You can add textures to Halo materials but if you do so you must set HaloTex in these controls or the texture will not show.


World Materials & Textures

Blender has an excellent world materials setting where one can create atmosphere for our scenes. In the majority of cases simple backgrounds are all that are required to turn scenes into something special.

The world settings button can be selected by F8, or by LMB Template-LMB.png the world icon on the buttons bar.

BSOD-Materials-Texture-buttons2.jpg


One of the most useful is the Mist tab.

Mist

Mist can help add atmosphere to almost any natural environment. Blender’s method of generating mist uses a quick and dirty method to simulate fading of objects the closer to the horizon they are. It achieves this by taking the Zenith color setting and causing materials to become more transparent to that color the closer to the horizon they are. This can lead to problems with alpha in individual materials. That is why I had the problem with the background grass and Ztransp.

However, with careful use it can be used quite effectively.

BSOD-Materials-textures-strands10.jpg

BSOD-Materials-textures-strands9.jpg
Textures can be added to the world setting and here a cloud texture has been mapped to the blend to give a blue grey cloud sky.

The Map To and Texture Input tabs are slightly different from normal materials. But basically we define the size and orientation via the Texture and Input, and how the texture will combine with the background color via the Map To tab.

You can find out more about the World settings here.

http://mediawiki.blender.org/index.php/Manual/PartVI


Final Render of the waterfall

Well we have reached the conclusion of this training material. By now you have gone through many of the common tasks necessary to produce accurate material and texture creation. Before we leave lets do a final render of our waterfall scene.


BSOD-Materials-Textures-waterfall.jpg


Apart from rendering a nice still image you might want to create an animation. After all Blender is a great 3D animation suite.

NOTE:
If you are new to this a little word of warning:-
Animating a scene above about 640 x 480 will take some time to complete. I animated the scene at slightly over that size and it took 5 hours to animate 200 frames.

Creating an Animation F10 to bring up the Render button.

BSOD-Materials-textures-animate1.jpg
  • The Output tab can be set to where you will render the animation.
  • Set Threads if you have a duel processor PC it almost half’s the render time.
  • choose OSA (Over sampling) level and the scale to render to.
  • Set the Sta(art) and End frames.
  • Set the size of the render, using the default switches on the right if necessary. Remember that the Scale setting earlier will define the proportional size of the resultant render.
  • Choose the output type and quality here.
  • Press the Animate button to start the animation process.
  • Retire to a safe distance and enjoy a well earned rest.



I hope you have enjoyed this tutorial. I have attempted to cover all the necessary material and Texture controls so that you can begin working your magic creating stimulating scenes in Blender. Don’t be afraid to make mistakes because you will always learn new things by breaking the rules.

Your final exercise

Simple material changes to create a Lava Fall

I said earlier that you would be able to change the waterfall to a lavafall. Well now is the time to do that. Rather than me tell you all the keystrokes and changes necessary I offer you the challenge to make those changes yourself.

However, I won’t leave you totally high and dry because here is my Lavafall blendfile for reference.

Media: BSOD-lavafall.blend

BSOD-Materials-Textures-lavafall.jpg



Good Luck with your Material Creations in Blender

UPDATE Part 3 of this tutorial introducing Material Nodes will be available (date unknown)

Colin Litster (Cog) Blender Summer of Documentation 2006




Contents