From BlenderWiki
[edit] Materials
Next, we'll add materials to make the character more interesting. A material is a combination of colors, textures, and settings that tell Blender how an object reacts to light.
For details, see Manual/PartIII/Materials_in_practice. Or, follow along by doing:
[edit] To add a material to an object
Let's add a material to the character mesh.
- Make sure the body is selected
- In the Buttons window, first click on the gray sphere in the header (or use the shortcut F5). These are the Shader buttons. There are so many Shader buttons that they won't all fit on one screen, so more buttons show up on the header.
- Click on the red sphere to get to the Material buttons, as shown in Adding a material. You may notice that there are other buttons next to the red sphere - these are for lights, textures, radiosity, and settings for the "world". More on these later.
- In the Links and Pipeline panel under the Materials buttons click the Add new button (Adding a material). Alternatively, click the arrows next to the text box that says Add New and select (you guessed it) Add New.
As soon as you clicked Add New, a whole lotta stuff just popped up in the Materials window. These are the material controls, which we'll tweak to get just the right look.
[edit] Skin material color
Now we can start changing material settings.
- Name the material by clicking in the text box in the Links and Pipeline panel. The default name is "Material"; I called this material "Body" (Name changed to Body).
- Choose a color by clicking the (by default, white) box next to the Col button in the Material tab (as in Click on the indicated box). A color chooser pops up.
- Choose a color or type in a hex code for a precise color. Move the mouse away from the color chooser to accept the color change. I used a light blue (hex code B3C3EA). Note how the character mesh in the 3D Window turns the color of the material.
[edit] Skin material shaders
Shaders determine how the material will react to light. You can adjust the shaders so you get a bright shiny material or a dull one.
- In the Material buttons, go to the Shaders panel (Shaders panel).
- Feel free to play with the different Diffuse and Specular shaders.
In this case, I made the following choices to make a sort of skin texture that was not too shiny and not too dull:
- Diffuse Shader: Oren-Nayer
- Ref = 0.8 (Reflection)
- Rough = 0 (Roughness)
- Specular Shader: WardIso
- Spec = 0.1 (Intensity of specular)
- rms = 0.255 (how focused the specular is)
You can check out what the material looks like on different objects by pressing the buttons to the right of the Material Preview panel. Default is a Plane, but you can try out the other objects.
For more on materials, check out this excellent shader discussion.
[edit] Add skin textures
A texture is an image that is associated with a material. A texture can affect different parts of a material - like specularity (how shiny it is), color, reflectance, or even how bumpy the surface is (a "bump map").
With a grayscale texture, lighter shades affect the material more, and darker shades affect the material less. In other words, the texture image affects the material depending on where the image is light and where it's dark.
We will add a texture to the skin material to make it look less like plastic.
- In the Buttons window and in the Shading context, click on the button indicated in Texture buttons to get to the Texture buttons. You can also press F6 as a shortcut.
- Click on Add New (Adding a new texture) to add a texture.
A new texture, called "Tex", is occupying the first of 10 texture slots. This means that you can have up to 10 textures on any single material. Each one of those textures can be a different type, and can affect a different part of the material.
- Next, choose a type of texture. By default, the type is "None". Pretty boring.
- Choose Clouds (Choosing a Clouds texture).
- The new Clouds texture is shown in the panel on the left side of the window (The Noise texture). Note also that a settings panel popped up as well, but we'll accept the default settings and leave that alone.
- Name this texture Clouds (we'll be adding two more cloud textures later).
- Now go back to the Material buttons (the red sphere, or F5). Note that in the Material Preview, the material is now blue with pink clouds (Textures affect color by default). That's because by default, a new texture affects the color of a material. Also by default, the color that is affected happens to be a really ugly magenta.
Here's what's happening: Wherever the Clouds texture we just added is lighter, there is correspondingly more magenta applied to the material. Conversely, where the Clouds texture is darker, there is correspondingly less color applied. Let's change the texture settings to make the texture affect the roughness or bumpiness of the skin instead of affecting the color.
- Go to the Texture tab in the Materials buttons (Texture panel in the Materials buttons).
- Select another texture channel button in the Texture panel, and assign the Clouds texture to that channel by choosing it in the menu to the right.
- Select a third texture channel button, and assign the Clouds texture to that as well. We've created one Clouds texture, and we'll reuse it three times for the skin texture. You'll see shortly why we're adding it three times to the material.
- Select the first texture channel. Make sure there's a check in the box next to the texture name. The check means that means the texture will be applied to the material, and the pressed button means that when we switch to the Map Input and Map To panels, we will be making changes to this texture channel.
The way to look at this is this:
- We created one Clouds texture in the Texture buttons. This texture can be used in any material.
- We added the Clouds texture to three separate texture channels in the Skin material. We could have put any texture in any one of those texture channels.
- We selected the first texture channel to make it active. We will now make changes to the settings of this texture channel to define how it will affect the material.
- Now click on the Map Input tab, also in the Material buttons (The Map Input panel). These are settings that determine the relative size and direction of the texture, before it gets to the material. We want to shrink the pattern of the cloud texture so it will look better on the character.
- In the "SizeX" number box, change the scaling factor to 5.
- Do the same for "SizeY" and "SizeZ". Important: larger numbers mean the pattern shrinks. Negative numbers mean the pattern gets larger. We are effectively shrinking the texture by a factor of 5 (Result of scling the Clouds1 texture).
Note
If the screen shots of the resultant material textures do not match what you see in your Preview window, remember that multiple textures are combined when there is more than one texture active (having a check mark by the left of it). If you only want to see the result of one particular texture channel then deactivate the other textures by removing their check marks. Don't forget to reactivate the texture channels afterwards though.)
|
- See Manual/PartIV/Map_Input for more details on the Map Input panel.
- Click on the Map To tab (The Map To panel, default settings). You can see where the color of the texture is controlled: the color box that is by default pink. Don't bother changing this, because we're going to disable the texture from affecting the color.
- Click on the Col button to turn off Color.
- Click on the Nor button to turn on Normals. The Preview reflects this change (Preview of the clouds texture). This makes the Clouds texture into a bump map: where the texture is white, there will be a raised bump. Where it is black, there will be a depression.
- Try rendering to see the effect of this texture with F12.
See Manual/PartIV/Map_To for more details on the Map To tab.
Now, change the second Clouds texture into a bump map.
- Go back to the Texture panel under the Material butons.
- Select the second texture channel.
- In the Map Input panel, instead of changing SizeX, SizeY, and SizeZ to 5, change them to 25. That means that this channel will be shrinking the Clouds texture more than the first channel.
- In the Map To panel, deselect Col and select Nor, as before.
Change the third cloud texture in the same way, except change SizeX, SizeY, and SizeZ all to 50.
You should end up with a material that has three different sizes of the Clouds texture applied to it. Here's a render of it:
To finish the skin material, we'll add a color ramp. This affects how light reacts to the material around the edges, and will give the skin a nice look.
- In the Material buttons, click on the Ramps tab (Ramps panel). You can learn more about ramps here.
- Click on the Colorband button. Lots of controls pop up.
- By default, there are 2 colors on the colorband: black, on the left, and teal, on the right. This creates a gradient of color. There is also a gradient of transparency (or alpha): on the left is completely transparent (alpha = 0), and on the right is completely opaque (alpha = 1). There are currently two locations along the colorband, location 0 (the black) and location 1 (the teal).
- Change the color of the first location from black to the same color as the skin material. I entered the hex code B3C3EA.
- Change the alpha (the "A" slider) to 1.0. This makes the location on the colorband completely opaque.
- Now switch to the second location on the colorband by clicking on the Cur button in the Ramps panel. This takes us to the location where we can change the right side of the colorband.
- Change the color from teal to full white.
- Change the Input to Normal in the Input menu (Change the Input to Normal). This makes the colorband react to the direction light is coming in on the character.
- Do a test render with F12 to see the effect of the Color Ramp.
Let's change the color of the background. To do this,
- Go to the Shader buttons.
- Click on the World buttons (World buttons). Here, we can make changes to the background color of our render.
- Click on the color box to change the color (The World panel). I changed the blue to a light gray (hex# DCDCDC)
- Test render!
file up to this point:Media:Tutorial-body-in-progress.blend
[edit] Multiple materials on a single object
Now, let's add some materials to the eyes. To do this, we're going to create two new materials, and apply both of them to different parts of the same object: an eyeball material, and a pupil material.
[edit] Create an eyeball material
- Select one of the eyes.
- In the Material buttons (F5), add a new material by clicking on the arrows next to the material name and choosing ADD NEW.
- Name the new material "Eye"
- Change the color to white.
- In the Shaders panel, I left the default settings alone, except for increasing the diffuse shader's Ref (Reflectance) to 1.0. (Shader settings for the Eye material). This makes the eye a bright white when rendered by reflecting all the light that comes to it.
[edit] Create a Pupil material
Here comes the tricky part. We're going to add a second material (a black Pupil material) to the eye . . . but only to the faces of the eye mesh that make up the pupil. The rest of the eye will retain the bright white Eye material we just assigned it.
- Make sure you still have the eye selected
- Under the Edit buttons (F9), look for the Link and Materials buttons (Link and Materials panel in Edit buttons, default settings).
- Click the New button under material. This adds a new material index to the object, in this case, the eye.
- There will be a "2 Mat 2" in the box. This means "There are 2 material indices, and index #2 is selected". "2 Mat 1" would mean material index #1 is selected (New Material index added to the mesh). By clicking the arrows to the left and right of the material slots, you can select which index is selected, by watching the second number.
Before going to the next step, verify that material index #2 is selected. We're going to attach a Pupil material to index #2, then assign the pupil vertices of the eye mesh to index #2.
- Go back to the Material buttons (F5).
- Add a new material. Name it something like "Pupil".
- Make it black.
- I turned Spec (Specularity) all the way down to 0.0 to make a flat black color.
- In the 3D Window, press 2 to view only Layer 2, where we put the eyes back when we created them.
- Enter the eye object's Edit Mode (TAB).
- Select the faces that you'd like to apply the pupil texture to. I selected the front vertex, and the first ring of vertices (Selecting the vertices to apply the pupil material to).
- Go back to the Edit buttons (F9).
- In the Edit buttons back where you added a new material index, note that the material index now has the "Pupil" material assigned to it. That's because we had this index selected while changing material settings.
- Click the Assign button to assign the active material index (which should still be #2 out of 2) to the selected vertices (Press the Assign button).
Now there is a second material assigned to just the faces that make up the pupil in the eye. Next, we'll do the same thing for the other eye. Since the Eye and Pupil materials are already created, just do these steps:
- Switch to Object mode
- Select the other eye.
- Go to Material buttons with F5.
- Assign the Eye material to the entire mesh by selecting the Eye material in the Link and Materials (don't click Add New, we already have the Eye material made).
- Go to Edit buttons (F9), and make a new material index for this material.
- With the new (second, or "2 Mat 2") slot selected, go back to Material buttons (F5).
- Select the Pupil material from the dropdown box to assign this material to the second material slot.
- Switch to Edit Mode and select the faces that make up the pupil.
- Go back to the Edit buttons (F9).
- With the vertices selected, hit Assign in the Link and Materials panel to assign the selected vertices to the material index.
You can find a summary table of the steps to add multiple materials to an object here:
BSoD/Introduction_to_Character_Animation/Multiple_materials
[edit] Rotate the eyes outward
We've got eyes! However, the eyes look sort of cross-eyed, mostly because of the geometry of the face (it's not exactly a realistic face!). To make it look right, we'll have to rotate the eyes outward to make them look better.
- Select the CHARACTER'S left eye (the one on the right side of the screen in Front View). It may be easiest to view Layer 2 (2), select the eye, then view all layers (`).
With the character's left eye selected:
- Switch to Edit mode
- Select all vertices with A
- Hit R to Rotate . . . but instead of moving the mouse to rotate, hit Z to constrain rotation around the Z-axis, and type the numbers -18, then Enter. This will rotate the left eye 18 degrees outward around the Z-axis. Depending on how you created your character, you may need more or less rotation to make the eyes look better.
- Select the other eye (the character's right eye), and rotate it 18 degree around the Z-axis in the other direction (R-Z-1-8-Enter).
[edit] Change the inside of the mouth to a different material
In the same way we just added a second material to the eyes, let's add a second material to the character mesh.
- Switch to Object mode
- Select the character mesh.
- Go to Edit buttons (F9), and make a new material index for this material.
- With the new (second, or "2 Mat 2") slot selected, go back to Material buttons (F5).
- We can actually reuse the Pupil material for the inside of the mouth. It's dark and unreflective, so it should work well. Select the Pupil material from the dropdown box to assign this material to the second material slot of the character mesh.
- Switch to Edit Mode and select the faces that make up the inside of the mouth. You will probably have to enter Wireframe mode (Z) or use the Clipping Border (Alt B to select just the vertices on the inside of the mouth.
- Go back to the Edit buttons (F9).
- With the vertices selected, hit Assign in the Link and Materials panel to assign the selected vertices to the material index.
We won't be able to actually see the inside of the mouth until we start making facial expressions, but now the materials for the mouth are done and we won't have to worry about them any more.
Summary
We've added a material to the body that had a texture on three different texture channels, and added two materials to the eyes. We had to rotate the eyes outward to make them look good for this character. Next, we'll rig the character with an armature (an armature is sort of like a skeleton) so we can animate it.
|
Next: Upper body: building the armature
Previous: Lighting









![[]](/skins/blender/open.png)
