Chapter 1 AL Texturing and Lighting a Product, Part 1 RI In this chapter and Chapter 2, “Texturing and Lighting a Product, Part 2,” TE you will texture and light a pair of headphones.
■ Chapter 1: Texturing and Lighting a Product, Part 1 Project: Reviewing the Scene File Before starting the texturing process, review the scene file and its contents. Open the headphones-start.ma scene file from the ProjectFiles/Project1 folder on the DVD. The scene hierarchy, surface UV texture space, camera setup, and unique light box geometry should all be examined before proceeding further. Checking the Hierarchy and UVs Figure 1.1 (Left) Hypergraph view of the headphones hierarchy.
Project: Reviewing the Scene File ■ 3 Figure 1.3). The box indicates the outer edge of the render; surfaces outside the box will not render. To toggle the Resolution Gate on or off for any camera, choose View ➔ Camera Settings ➔ Resolution Gate from the view panel menu. To manipulate the persp camera, select the persp node in the Hypergraph or Outliner and use the standard transform tools. You can also interactively move the camera with the Alt key and mouse buttons in a perspective view panel. Figure 1.
■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.4 In this chapter, you’ll use the Light_Box cube to create large specular highlights and reflections in the plastic and metal of the headphones. In Chapter 2, you’ll have the chance to illuminate the scene by using the Light_Box cube’s material attributes and the Final Gathering rendering option. (Top) The Light_Box cube.
Material Types and Critical Attributes ■ 5 The shared attributes include the following: Color Color determines its namesake. You can enter specific red, green, and blue values by clicking the color swatch and updating the Color Chooser window. For more information on the Color Chooser window, see the “Adjusting Colors and Transparency” section later in this chapter. Transparency Much like Color, Transparency uses a color swatch.
■ Chapter 1: Texturing and Lighting a Product, Part 1 value produces a bright surface. A low Diffuse value causes light rays to be absorbed and thereby makes the surface dark. Translucence, Translucence Depth, Translucence Focus The Translucence attribute, in conjunc- tion with Translucence Depth and Translucence Focus, simulates the diffuse penetration of light into a solid surface. In the real world, you can see the effect when holding a flashlight to the palm of your hand.
Material Types and Critical Attributes ■ 7 Keep in mind that 3D specular highlights are an artificial construct. Real-world specular highlights are actually reflections of intense light sources, such as a day sky or a bright lamp. The intensity of the Maya specular highlight is controlled by the Specular Roll Off (Blinn), Whiteness (Phong E), and Fresnel Index (Anisotropic). With the Phong material, you can adjust the specular intensity by changing the Specular Color. Figure 1.
■ Chapter 1: Texturing and Lighting a Product, Part 1 an alpha channel and the RGB channels remain black. This offers a handy means to render shadows as a separate render pass. For a demonstration of the Use Background material and render passes, see Chapter 6, “Texturing and Lighting a Vehicle, Part 2.” For a demonstration of image plane use, see Chapter 5. Layered Shader The Layered Shader material allows you to combine two or more materials. For a demonstration, see Chapter 7.
Project: Assigning Materials panel, do so while the Select By Object Type button is activated on the Status Line (see Figure 1.10). If the Select By Hierarchy And Combinations button is activated instead, you may inadvertently select a group node. If a material is assigned to a group node, all the group node’s children automatically inherit the same material. Exploring Shading Networks A B C ■ 9 D Figure 1.
■ Chapter 1: Texturing and Lighting a Product, Part 1 is inappropriate and a Blinn is suitable. As such, Table 1.1 lists each of the surfaces found in the headphones scene file, the real-world material it will try to emulate, and the recommended Maya material type. Table 1.
Project: Assigning Materials ■ 11 an incorrect face, deselect it by Ctrl+clicking. After all the floor faces are selected, return to the Hypershade window, RMB+click the new Blinn material, and choose Assign Material To Selection from the marking menu. 3. In a view panel, select the entire Light_Box. This deselects the floor faces and selects the remaining faces. Return to the Hypershade and assign the selected faces to the new Surface Shader material.
■ Chapter 1: Texturing and Lighting a Product, Part 1 scene file, the grommets alone should be a semitransparent plastic. As such, set the corresponding material’s Transparency color swatch to a medium gray. Lighting Techniques and Maya Light Types Successful lighting in animation depends on a wealth of techniques developed for cinematography and still photography. This necessitates an understanding of Maya light types and the equivalent real-world lights they emulate.
Lighting Techniques and Maya Light Types soft-edged shadows. A focused light, on the other hand, creates parallel rays of light that create hard-edged shadows. Diffuse lights are often referred to as soft. Focused lights are often referred to as hard. Adding Lights to a Scene When adding lights in Maya, it’s generally best to create one at a time. That is, each light should be satisfactorily positioned and adjusted before additional lights are created.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Rim Fill Key Figure 1.14 (Top Left) Mannequin lit by a key light. (Top Right) Mannequin lit by key and fill. (Bottom Left) Mannequin lit by key, fill, and rim. (Bottom Right) Positions of all three lights as seen in a Top view panel. The three lighting scenarios are included as key.ma, key_fill.ma, and key_fill_rim.ma in the ProjectFiles/Project1/ Reference folder on the DVD.
Lighting Techniques and Maya Light Types Figure 1.15 (Top Row) Maya light types. (Bottom Row) The corresponding real-world lighting scenarios emulated by Maya lights.
■ Chapter 1: Texturing and Lighting a Product, Part 1 Project: Creating Lights and Shadows After you’ve adjusted the material Color and Transparency attributes, you can begin lighting. Although Maya provides a default light when no light nodes are present, the light quality is not driven by any particular light source. Hence, the default light is not suitable for judging assigned materials or added textures.
Project: Creating Lights and Shadows ■ 17 Figure 1.17 Headphones lit with an area light serving as a key. The Diffuse and Color attributes of several materials are adjusted. A sample file is saved as headphones -step2.ma on the DVD. As you adjust the materials, render out additional tests in the Render View window. To save time, render out only the region of interest. You can define a region by LMB+dragging in the Render View render area to form a red region box.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.18 Eccentricity, Specular Roll Off, and Specular Color attributes of materials are adjusted. A sample file is saved as headphones -step3.ma on the DVD. For a color version of the figure, see the color insert. While adjusting the specular quality of each material, check each of the Reflectivity attributes. For any material that need not be reflective, set the Reflectivity attribute to 0.
2D and 3D Procedural Textures ■ 19 the light is encoded in various shades of gray; surfaces close to the light receive higher values, and surfaces far from the light receive lower values. If there is only one light in a scene, the shadow renders black. You can add a fi ll light to brighten the shadow. However, the fi ll light will also brighten the unshadowed area of the surface. An alternative solution is to adjust the light’s Shadow Color attribute. For example, in Figure 1.
■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.20 time across the surface in the U and V directions. Additionally, the 2d Placement utility node offers attributes to offset, mirror, or rotate the procedural pattern. Filter Size is set to 32, and Shadow Color is set to a light blue. A sample file is saved as headphones -step5.ma on the DVD. Figure 1.21 (Top) A 2d Placement utility node, automatically named place2dTexture1, connected to a Noise texture node.
Project: Applying Textures ■ 21 rotation of the placement box affects the way in which the texture appears across the assigned surface. If the surface is transformed relative to the box or deforms over time, the texture will change. To avoid such a change, it may be necessary to parent the 3d Placement node to the surface. More drastically, you can convert 3D textures to 2D textures through the Convert To File Texture tool.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.23 (Top) Detail of render after addition of the Leather texture as a bump map. (Bottom) Render after the adjustment of the Bump 3d and Leather node attributes. A sample file is saved as headphones -step6.ma on the DVD. 4. Open the new Leather node’s Attribute Editor tab. Reduce the Cell Size to 0.8 to enlarge the overall size of the pattern. Despite this adjustment, vertical lines appear across the surface.
Project: Applying Textures ■ 23 2. Open the Hypershade. Create a new Blinn material. Name the new Blinn Leather_Pad_Edge or something equally appropriate. Return to the UV Texture Editor. Clear the face selection by clicking on an empty area of the UV space. LMB+drag a selection box around the bottom square shell. All the edge faces are selected. Return to the Hypershade. RMB+click the new Blinn node and choose Assign Material To Selection.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 The Foam surface, which represents the material covering the headphone’s built-in speakers, can also benefit from a bump-mapped noise. To add such a bump, follow these steps: Figure 1.26 1. In the Hypershade, select the material assigned to the Foam_L and Foam_R surfaces. (The included sample scene files use the Foam material.) Open the material’s Attribute Editor tab and click the checkered Map button beside the Bump Mapping attribute.
Project: Applying Textures ■ 25 In this case, it’s best to choose a resolution that will match the desired resolution of the final texture. For example, 1024 ×1024 is appropriate for a small piece of geometry when rendering at HD 720. Change the Image Format menu to a format that’s supported by a digital paint program (such as Photoshop). For example, JPEG is a commonly used format that produces sufficient quality for the texture-painting process.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.29 (Left) Detail of color variation added to the black representing the plastic. The contrast is exaggerated for print. The actual texture variation is more subtle. (Right) Photo of screw head pasted twice into texture, as seen in Photoshop. A finished texture is included as Junction_Color.tga in the ProjectFiles/ Project1/Textures folder on the DVD. as UV_setup.psd in the ProjectFiles/Project1/Reference folder on the DVD.
Project: Applying Textures ■ 27 Figure 1.30 6. When you’ve finished painting the various layers, choose Layer ➔ Flatten Image. Choose File ➔ Save and select a Maya-compatible file format. Targa or TIFF are both high-quality formats. When choosing a filename, strive for clarity. For example, name the file Junction_Color. Return to Maya. Open the Hypershade, select the material assigned to the Junction_R surface, and open its Attribute Editor tab. Click the Color checkered Map button.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.32 and browsing for the Project1 folder whether the folder remains at its original location on the DVD or is located on a drive after the DVD contents have been copied. When creating custom bitmaps, you’re not limited to color. For example, you can create the illusion that the plastic junction is composed of two halves with a central groove by painting a new texture and mapping it to the Bump Mapping attribute of the associated material.
Project: Applying Textures ■ 29 Figure 1.33 (Left) Custom color texture. (Right) Ear cup rendered with logo. A sample file is saved as head phones -step10.ma. A finished texture is included as Ear_ Cup_Color.tga in the ProjectFiles/ Project1/Textures folder on the DVD. The headphone ear pads can also benefit from a custom bump texture. The Pad_L and Pad_R surfaces utilize the full UV texture space with a single UV shell for each surface.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Figure 1.35 (Left) A custom bump texture with vertical lines to replicate bunched leather and short horizontal dashes to re-create stitching. The texture is included as Ear_ Pad_Bump.tgain the Project Files/ Project1/Textures folder on the DVD. (Right) Detail of render after the addition of the bump texture. A sample file is saved as headphones -step11.ma. Figure 1.36 (Left) Generic Specular Roll Off texture.
Scanline and R aytraced Rendering To create a generic noise pattern, you can combine photos of real-world surfaces. Rusty metal, stucco, dirty concrete, and similar surfaces often contain interesting patterns. In fact, if you layer several different photos in Photoshop and adjust each layer’s Opacity, you can generate a more complex result. For example, if you stack three different rusty metal photos and reduce each layer’s Opacity, an interesting pattern forms (see Figure 1.37).
■ Chapter 1: Texturing and Lighting a Product, Part 1 • The final color of each pixel within a scanline is based on the material qualities of the polygon face found within the pixel. In addition, the surface’s relationship to lights and cast shadows is taken into account. • To optimize memory usage, the scanline approach is often broken into tiles. The size of any given tile is based on the number and complexity of surfaces found with a particular area of the camera’s view.
Project: R aytracing Reflections A list of the most critical attributes and their functionality follows: Refractions Activates refractivity for the surface assigned to the material. For the refrac- tivity to be visible, the material’s Transparency attribute must be set above 0. Refractive Index Determines the degree of refractivity present. If set to the default 1.0, no refraction occurs.
■ ■ Chapter 1: Texturing and Lighting a Product, Part 1 Table 1.2 Recommended Reflectivity settings Figure 1.40 Final Chapter 1 render. A sample file is saved as head phones-step13. ma on the DVD. For a color version of the figure, see the color insert. Surface Name SPecular color reflectiVity Slider_L/R Junction_L/R Cup_L/R Grommet_L/R Light_Box (Floor material) Mid-gray (0.4, 0.4, 0.4) Mid-gray (0.4, 0.4, 0.4) Mid-gray (0.35, 0.35, 0.35) Gold (0.5, 0.4, 0) Default gray (0.5, 0.5, 0.5) 1 0.1 0.