• No results found

5.1 Introduction to Textures 5.2 Texture Mapping 5.3 Displacement Mapping 5.4 UV Texture Mapping

5.5 Selective UV Texture Mapping 5.6 Unwrapping with Seams 5.7 Texture Paint

5.1 Introduction to Textures

In Chapter 4, we considered the eff ect of light refl ecting off a smooth surface. Textures are the physical characteristics or imperfections of a surface such as the grainy surface of bricks, the fi brous pile of carpet, wood grain, etc.

In Blender, the visualization of these types of surface characteristics is created by map-ping images on to the surface of a model in the 3D window. In this case, the images are called textures. In Blender, there are three texture modes: material, world background, and brush. Besides creating surface characteristics, textures are used to sculpt, paint, and de-form objects. Textures are also used by several of Blender’s modifi ers.

It should be noted that textures do not display in the 3D window. An image of the scene must be rendered to see the texture; this is to save processing power.

5.1.1 Material Textures

Before you can add a texture to a surface you must fi rst add a material because, by default, Blender textures are set to infl uence the material. Textures are applied to an object’s sur-face using the options in the properties window – “Textures” button. Clicking the “Tex-tures” button displays a panel where you can add a new texture. Blender comes with a series of built-in textures from which to choose or you can use any photo or image stored on your computer. Blender can also place movies on a surface and you can animate the textures.

To demonstrate the placing of a texture, follow this example. Open a new Blender scene, replace the default cube with a plane, and scale the plane up by 5. Add a material with R: 0.800, G: 0.767, and B: 0.495 values.

Go to the properties window – “Textures” but-ton and click “New” (Figure 5.1).

Note: By default, material texture mode is active.

The texture buttons display with a default texture type “Clouds” shown in the “Preview”

tab. Also notice that the properties window displays a “Clouds” tab (Figure 5.2, left). This tab contains settings for altering the charac-teristics of the texture, and the tab will change depending on what texture type is selected.

Figure 5.1

Properties window

Click “New.”

“Textures” button

Figure 5.2

Texture mode buttons

Click for the drop down menu.

Click on the texture type drop down menu and select the

“Magic” tab.

111 5.1. Introduction to Textures

Click on the texture type drop down menu and select the “Magic” tab. Th e cloud texture is replaced by the magic texture and the “Clouds” tab is replaced by the “Magic” tab (Figure 5.2, right). Th is tab con-tains only two values for altering the characteristics of the texture: depth and turbulence. Note that the 3D window does not show the texture on the object.

Th is is where Blender conserves memory. Render (press F12) to see the texture (Figure 5.3). Change the depth value to 4 and render again to see the alteration (Figure 5.4). Go back to the texture type drop down selection and select “Image or Movie.”

An “Image” tab displays instead of the “Magic”

tab and the preview shows a black window—we haven’t told Blender what image to use.

In the “Image” tab, click “Open” (Figure 5.5).

Th e fi le browser window displays. Navigate to a fi le containing a picture (I have a picture named

“Street.jpg” in my “Documents” folder). Click on the picture fi le then click “Open” at the top RHS of the screen.

You will see your picture in the preview panel (probably multiple images). Render to see your picture displayed on the surface of the plane

(Fig-ure 5.6). Click “Open.” Rendered image with depth 4

Rendered image on the surface of the plane

5.2 Texture Mapping

Whether you use one of Blender’s built in textures or an image, you may want to adjust how the texture is positioned on the object. The “Mapping” tab is the place to do this (Figure 5.7).

“Offset” and “Size” are self-explanatory, and can be controlled on either the x-, y-, or z-axis. The

“Coordinates” drop down menu gives you a selection of coordinate systems, and the “Projec-tion” drop down menu has a choice of mapping options to suit

the shape of your object (Figure 5.8).

There are a lot of buttons and settings to experiment with in the “Texture” screen and the best way to find out what they do is to play around and record your results for future reference.

Figure 5.7

Figure 5.8

Flat Cube

Sphere Tube

113 5.3. Displacement Mapping

5.3 Displacement Mapping

Displacement mapping is using a texture to deform a mesh. You can make a cube or a sphere look wrinkled without having to move vertices around. Start a new Blender scene with the default cube. Make sure the cube has a material, then in edit mode, subdivide the cube six times. Th e texture is going to displace vertices, so you need a whole bunch of ver-tices to work with.

Put a cloud texture on the cube then go to the “Infl uence” tab. Leave the “Diff use: Color”

ticked. Under the “Geometry” heading, tick “Displace” and alter the value as shown in Fig-ure 5.9. Render to see the eff ect.

Moving the slider next to the “Displacement” box varies the amount of displacement.

Th e “Blend” drop down menu displays options that infl uence the material. Try “Add” and

“Subtract” and render to see the diff erence. Another example is shown in Figure 5.10. Th is time, a black-and-white image texture has been used on a plane. Don’t forget to subdivide the plane. Negative displacement values raise the surface up, and positive values depress the surface. Experiment with other features and record the outcomes for future reference.

Bump Textures Learning Unit 8

Figure 5.9

Figure 5.10 Black-and-white image

Rendered image with a negative displacement value

5.4 UV Texture Mapping

For complex models, regular flat, cubic, cylindrical, or spherical texture mapping is not suf-ficient to accurately place the texture on the surface. This is where UV mapping can help.

The coordinates u and v are used simply to distinguish from the x,y,z-coordinates used in the 3D window.

UV mapping is accomplished by taking the surface of an object (the model), peeling it off as you would a skin from an orange, and laying it out flat on a 2D surface. An image is then superimposed as a texture over the flattened surface (this is known as mapping). The window for laying out the flattened object is the UV/image editor window. As with every basic instruction in Blender, it is best to begin with something simple. Although the process we are describing is for complex surfaces, anything other than simple is going to be confus-ing at first.

Start with a cube object in Blender’s default 3D scene; delete the cube that is loaded automatically and add a new cube. The default cube comes preloaded with a material and a texture channel. In our previous discussion on material and textures, I stated that before a texture could be applied, an object had to have a material. Adding to the scene a new cube that does not have a material or a texture will demonstrate that neither are necessary to ap-ply UV texture mapping (Figure 5.11).

With the new cube added, split the 3D window in two and change one half to the UV/

image editor. In the 3D window, zoom in on the cube—when you split the window, the cube is a little too small to see this process clearly. Change the 3D window to edit mode and select “Textured” as the viewport shading type; this will allow you to see the superimposed texture (Figure 5.12).

In the 3D window tools panel under “UV Mapping,” click on “Unwrap” to display the menu for selecting the UV mapping unwrapping type (Figure 5.13). These options allow you to unwrap the surface of the selected object in a variety of ways. Some of the unwrap-Figure 5.11 A new cube is added; no material is applied.

Properties window – “Material” button

115 5.4. UV Texture Mapping

ping methods are difficult to visualize, so the only way to learn is to experiment and record your findings.

To keep things simple, select the “Follow Active Quads – Edge Length Mode – Length”

method for unwrapping the cube and press

“OK” (Figure 5.14). This method will lay out the surface of the cube as if you had unfolded a post office mailing box. The surface will consist of six squares. The UV/image editor window will probably require you to zoom out to see the whole arrangement (use the number pad minus key, the same as you do in the 3D window). Now that the flattened surface is displayed, it’s time to load a texture image.

In the UV/image editor window header, click on “Image” and select “Open Image.”

This will display the file browser window where you can navigate and find an image to use as a texture. Once you have located your image file, click on it to select it and then click on “Open Image” (at the top RHS of the window). In my case, I have selected a picture file named “Chrysanthemum.jpg” in my C:\Users\Public\Pictures\SamplePictures\ directory (Figure 5.15). The image displays in the UV/image editor window.

Change to edit mode.

Select “Textured” as the viewport shading type.

Click on “Unwrap.”

Figure 5.12 Figure 5.13

Figure 5.14

Figure 5.15

Figure 5.16

File browser window Click to display the files as thumbnail images.

117 5.5. Selective UV Texture Mapping

Zoom out again if the image is too large.

The image shows in the center face, but you will see that it is mapped to each surface of the cube in the 3D window (Figure 5.16). With the cur-sor in the UV/image editor window, press the A key to select all the surfaces then the G key (grab) and move the selected surfaces around.

As you move the surfaces, you will see that the image is repositioned on the surfaces of the cube in the 3D window. The outline of the surfaces in the UV/image editor can be scaled and rotated the same as you would edit a mesh in the 3D window. Individual vertices on the mesh may be selected then grabbed and moved also. As you see by manipulating the surface outline in the UV/image editor, you can accu-rately position the texture image.

If you were to render an image of the ob-ject (by pressing F12) at this stage, you would be disappointed to see that the image texture does not render (Figure 5.17). To render the image texture, activate “Face Textures” in the

“Options” tab of the “Material” buttons in the properties window (Figure 5.18). Apply a ma-terial (the default dull gray color will do) and press F12 to see the rendered image.

5.5 Selective UV Texture Mapping So far, the image texture has been mapped to all the surfaces of the object, but suppose you wish to place the texture only on one face of the object. Create a new scene and leave the default cube selected. Split the 3D window as before and set up the UV/image editor win-dow. In the 3D window, tab to edit mode and select the “Textured” viewport shading.

In the 3D window, change from vertex se-lect mode to face sese-lect mode (Figure 5.19).

Deselect all faces then select only one face (right click on the face). In the UV/image editor window, select and enter an image for your texture as before, and you will see the image mapped to the face you selected in the 3D window. In this case, we didn’t do any Figure 5.17

Figure 5.18

unwrapping, but as soon as the image was entered in the UV/image editor, Blender automatically mapped the single face.

With the cursor in the UV/image editor window, press the A key to select the face. The white outline turns orange (Figure 5.20). You can then manipulate the face map to position your image the way you want. Remem-ber, use the G key to grab, the R key to rotate, and the S key to scale (Figure 5.21). Note that the face map in the UV/image editor is in vertex select mode. There are also the options to select edge and face modes similar to the selections in edit mode in the 3D window. There is also a fourth option, which is island select mode (Fig-ure 5.22). Some unwrapping operations divide the face mesh into separate parts, and island select allows you to select these parts.

Figure 5.19

Figure 5.20

Figure 5.21 One

face is selected.

The white outline turns orange.

Grab

Scale Rotate

Face select mode

119