Advanced Maya Texturing and Lighting- P16 docx

30 260 0
Advanced Maya Texturing and Lighting- P16 docx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

429 ■ ADDING REALISM WITH HDRI The Quality U and Quality V attributes set the size of a control texture that generates the virtual lights. For each pixel of the control texture, one light is created. To make the render feasible, the Samples attribute places a cap of the number of lights used. The first Samples field determines the minimum number of lights generated. The second Samples field determines the maximum number of additional lights that are randomly added to make the lighting less regular. Ultimately, the Light Shader creates diffuse lighting and shadows (see Fig- ure 13.11). Since the Light Shader does not require raytracing, Global Illumination, or Final Gather to function, it renders efficiently and quickly. However, if the Quality U and Quality V attributes are raised to high values, the Light Shader render will slow significantly. At the same time, if the Quality U and Quality V values are set too low, the render will appear grainy. Figure 13.11 (Left) The mannequin lit with the IBL Light Shader. Raytracing is used with nonreective surfaces. This scene is included on the CD as man_light.ma. (Right) The same scene with reective surfaces. This scene is included on the CD as man_light_reflect.ma. Using Light Probe Images with the Env Ball Texture Light probe (angular) HDR images are unique in that they are created by photograph- ing a high-reflective sphere. The sphere offers the advantage of capturing a nearly 360-degree view of an environment. The Env Ball environment texture in Maya, in fact, is designed to support light probe images. To create a light probe HDR image from scratch, follow these basic steps: 1. Digitally photograph a reflective sphere in a desired location. The example illustrated in Figure 13.12 employs a 12-inch stainless steel “gazing ball” that is sold as a lawn ornament. Take multiple photos with different F-stops and/or shutter speeds to properly expose all areas of the scene. 92730c13.indd 429 6/19/08 12:59:55 AM 430 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ Figure 13.12 (Top) Five exposures created by photographing a reective sphere. (Bottom) The resulting tone- mapped light probe HDR image. (The orange and blue colors are derived from the room’s lighting and wall color.) The light probe image is included on the CD as room.hdr. 2. Bring the photos into an HDR program that supports the light probe format, such as HDRShop. Combine the photos into a single light probe HDR image. (HDRShop includes detailed instructions in its help files.) It’s possible to refine the result by taking photos from multiple angles and stitching the photos together. Taking photos from multiple angles allows you to remove the reflected image of the photographer and camera. 3. Export the HDR image as an OpenEXR, .hdr, DDS, or floating-point TIFF bitmap. To use a light probe image with the Env Ball texture to create a reflection, follow these steps: 1. Create a test surface and assign it to a Blinn or Phong material. Open the mate- rial’s Attribute Editor tab. Click the checkered Map button beside Reflected Color. Choose the Env Ball texture from the Create Render Node window (in the Environment Textures section). 2. Load a light probe HDR image into the Env Ball’s Image attribute. If the HDR image is in the OpenEXR or floating-point TIFF format, set the attributes within the High Dynamic Range Image Preview Options section of the file’s Attribute Editor tab. If you are using an .hdr or DDS image, a median expo- sure level is automatically selected by the program. 3. Interactively scale the Env Ball projection icon, found at 0, 0, 0, so that it tightly surrounds the surface. Render a test frame. Raytracing is not required. 92730c13.indd 430 6/19/08 1:00:01 AM 431 ■ AN INTRODUCTION TO RENDERMAN FOR MAYA If the test surface is spherical, a clear reflection of the light probe image will be visible. However, if the surface is faceted or complex, the reflection may be soft and portions of the image may be severely magnified. To prevent this, adjust the Sky Radius attribute of the envBall node’s Attribute Editor tab (in the Projection Geom- etry section). Sky Radius establishes the world distance from the reflective ball to the real-world sky. In the case of Figure 13.12, there is no sky, so Sky Radius represents the distance to the ceiling. As an additional example, three Env Ball textures are mapped to three Phong materials assigned to three primitives in Figure 13.13. Although the Env Ball assigned to the sphere requires no Sky Radius adjustment, the Env Balls assigned to the helix and soccer ball shape require a Sky Radius value of 1.5. Unfortunately, choosing a Sky Radius value is not intuitive and requires test renders. The Sky Radius units are generic and do not correspond directly to Maya’s world units. Figure 13.13 Three Env Ball textures applied to three primitives. This scene is included on the CD as envball.ma. An Introduction to RenderMan For Maya RenderMan is a robust renderer developed by Pixar that has been used extensively in feature animation work for over a decade. In recent years, RenderMan has been made available as a plug-in for Maya. (For information on obtaining a copy of the RenderMan For Maya plug-in, visit http://renderman.pixar.com.) RenderMan For Maya can be activated by checking the RenderMan_for_maya.mll Loaded check box in the Plug-In Manager window. Once the plug-in is activated, RenderMan appears as an option of the Render Using attribute in the Render Settings window. Like other renderers, RenderMan carries its own set of rendering attributes. However, these are spread among four tabs—Quality, Features, Passes, and Advanced (see Figure 13.14). 92730c13.indd 431 6/19/08 1:00:05 AM 432 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ Figure 13.14 RenderMan attribute tabs in the Rendering Settings window RenderMan is able to render most of the geometry, materials, and effects in Maya, including depth-of-field, motion blur, raytracing, global illumination, caustics, subsurface scattering, HDR rendering, Maya Fur, Maya Hair, Paint Effects, and particles. In addition, RenderMan offers a large set of specialty render attributes. You can access the attributes by selecting the object you want to affect and choosing Attri- butes > RenderMan > Manage Attributes from the Attribute Editor menu. The Add/ Remove Attributes window opens (see Figure 13.15). Figure 13.15 The RenderMan Add/Remove Attributes window Available rendering attributes are listed in the Optional Attributes field. This is matched to the selected object. For instance, a NURBS surface produces a long list of attributes while a Paint Effects stroke produces a short list. To apply an attribute, 92730c13.indd 432 6/19/08 1:00:11 AM 433 ■ CREATING TEXTURES WITH THE TRANSFER MAPS TOOL highlight the attribute name and click the Add button. The attribute is added to the selected object node and is listed in the Extra RenderMan Attributes section of the node’s Attribute Editor tab. Available rendering attributes create a wide array of results on a per-object basis, including: R• aytraced motion blur P• er-surface control of culling and visibility P• er-surface control of diffuse illumination interaction S• ubdivision at point of render to negate faceting S• pecialized assignment of NURBS curves and other normally unrenderable nodes to shading groups RenderMan also provides its own advanced variation of a material editor named Slim. You can launch Slim by choosing Window > Rendering Editors > RenderMan > Slim. Much like the Hypershade, Slim allows you to create and edit materials, textures, and custom connections. However, Slim adds many advanced options not available to the Hypershade. In addition, Slim provides its own set of RenderMan materials, textures, and utilities. Any shading network created in Slim can be exported back to Maya. The new shading network appears in the Hypershade and thereafter is accessible to the RenderMan renderer. Creating Textures with the Transfer Maps Tool The Transfer Maps tool can create normal maps and displacement maps by comparing surfaces. In addition, the tool can bake lighting and texturing information. Normal Mapping Although normal maps are related to bump maps, there are significant differences: B• ump maps store scalar values designed to perturb surface normal vectors on a per-pixel basis. In contrast, normal maps store pre-calculated normal vectors as RGB values; normal maps pay no heed to the surface normal vectors provided by the surface, replacing them instead. N• ormal maps are often created by comparing a low-resolution surface to a high-resolution variation of the same surface. Thus, normal maps are able to impart high-resolution detail to a low-resolution surface. Bump maps lack this ability. N• ormal maps are not dependent on specific world units and thereby travel more easily between different 3D programs. To create a normal map with the Transfer Maps window, follow these steps: 1. Create a new scene. Build a high- and low-resolution version of a single-surface polygon model. (An example file, which includes a simple high- and low- resolution surface, is included as high_low.ma on the CD.) 92730c13.indd 433 6/19/08 1:00:14 AM 434 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ 2. Transform the high- and low-resolution surface to 0, 0, 0 in world space. It’s okay if they overlap. 3. Select the low-resolution surface, switch to the Rendering menu set, and choose Lighting/Shading > Transfer Maps. The low-resolution surface is listed auto- matically in the Target Meshes section of the Transfer Maps window. 4. Switch the Display drop-down menu, found in the Target Meshes section, to Envelope. Choose Shading > Smooth Shade All from a workspace view menu. The search envelope assigned to the low-resolution surface appears red. The search envelope is a “cage” in which the Transfer Maps tool searches for source surfaces during the normal mapping process. Initially, the search envelope is the same size as the low-resolution surface. To scale the search envelope, increase the Search Envelope % attribute slider, also found in the Target Meshes section. The search envelope should surround the high-resolution surface. 5. Expand the Source Meshes section of the window. By default, All Other Meshes is listed under the Name attribute. This means that the tool will evaluate all nontarget meshes it encounters within the search envelope. To specify the high- resolution surface as a source surface, select the high-resolution surface and click the Add Selected button. The name of the high-resolution surface appears under the Name attribute. 6. Click the Normal button (represented by the dimpled ball). Choose a destina- tion for the normal map by clicking the file browse button beside the Normal Map attribute. Choose a File Format. Normal maps can be written in any of the standard Maya image formats. Choose Map Height and Map Width values in the Maya Common Output section. Click the Bake And Close button at the bottom of the window. At this point, the Transfer Maps tool creates a new material, assigns it to the low-resolution surface, and loads the newly written normal map into a connected bump2d node. The Use As attribute of the bump2d node is set to Tangent Space Normals. To see the result, move the low-resolution surface away from the high- resolution surface and render a test. The result should be similar to Figure 13.16. Low-resolution surface 2,500 faces High-resolution surface 292,144 faces Figure 13.16 (Left to right) Normal map, low-resolution surface with normal map, high-resolution surface. This scene is included on the CD as normal_final.ma. The normal map is included as normal_map.tga in the textures folder. 92730c13.indd 434 6/19/08 1:00:22 AM 435 ■ CREATING TEXTURES WITH THE TRANSFER MAPS TOOL To improve the quality of the normal mapping process, you can adjust addi- tional attributes: Sampling Quality Found in the Maya Common Output section, Sampling Quality sets the number of samples taken for each pixel of the normal map. This serves as a subpixel sampling system. The higher the values, the more accurate the resulting normal map. Transfer In Found in the Maya Common Output section, Transfer In determines which space the normal map calculations are carried out in. If Transfer In is set to the default World Space, the target and source surfaces can be different sizes. How- ever, they must be positioned at the same world location. If Transfer In is set to Object Space, target and source surfaces can be moved apart; however, the Freeze Transformation tool should be applied while they are positioned at the same world location. If Transfer In is set to UV Space, the surfaces can be dissimilar (different shape or different proportions); however, the surfaces must carry valid UVs for this option to work. Map Space If the Map Space attribute (which is found in the Output Maps sec- tion) is set to Tangent Space, the normal vectors are encoded per vertex in tangent space. Tangent space is the local coordinate space of a vertex that is described by a tangent vector, a binormal vector, and the surface normal. The tangent vector is aligned with the surface’s U direction. The binormal vector is aligned with the surface’s V direction. If Map Space is set to Object Space, the resulting normal map takes on a rainbow hue. This is due to the surface normals always pointing in the same direction in object space regardless of the translation or rotation of the sur- face in world space. The Object Space option is only suitable for surfaces that are not animated. You can also create normal maps through the Render Layer Editor; an example is included in the section “Using Presets” later in this chapter. Creating Displacement Maps The best normal map cannot improve the quality of a low-resolution surface’s edges. However, the Transfer Maps tool is able to preserve the edge details of the high-resolution surface by creating a displacement map for the low-resolution sur- face. Steps to create a displacement map are almost identical to the steps to create a normal map: 1. Move the high-resolution surface and the low-resolution surface to the same point in world space. Assign the low-resolution surface to a new material. With the low-resolution surface selected, choose Lighting/Shading > Transfer Maps. The low-resolution surface is listed in the Target Meshes section. Select the high-resolution surface and click the Add Selected button in the Source Meshes section. 92730c13.indd 435 6/19/08 1:00:24 AM 436 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ 2. Click the Displace button. Click the file browse button beside the Displacement Map field and choose a destination for the displacement map to be written out. Choose an appropriate File Format and Map Width and Map Height. 3. Switch the Connect Maps To attribute, found in the Connect Output Maps section, to Assigned Shader. Click the Bake And Close button at the bottom of the window. 4. Move the low-resolution surface away from the high-resolution surface. Render a test frame. In this case, the displacement map is automatically connected to a displacementShader node, which in turn is connected to the Displacement Shader attribute of the material’s shading group node. Unfortunately, displacement maps created with the Transfer Maps tool often produce a “quilting” effect along the original polygon edges. That is, the faces of the low-resolution surface appear to be “puffed out” among the high-resolution surface detail. To reduce this potential problem, follow these guidelines: C• hange the Maximum Value attribute (found in the Output Maps section). Raising the value reduces the amount of contrast in the displacement map. In turn, this reduces the intensity of any quilting artifacts and prevents plateaus from forming when parts of the map become pure white. The ideal value varies with the surfaces involved. I• ncrease the Filter Size attribute (found in the Maya Common Output section) to add blur to the map. I• ncrementally raise the Initial Sample Rate and Extra Sample Rate attributes of the target surface. (These attributes are found in the Displacement Map section of the surface’s Attribute Editor tab.) This will increase the accuracy of the displacement. A• djust the Alpha Gain and Alpha Offset attributes of the File node that carries the displacement map. (See Chapter 9 for more information.) T• ouch up the map in Photoshop. The Displacement Shader interprets a 0 value as no displacement and a 1 value as maximum displacement. As an example, in Figure 13.17 a displacement map is generated by the Transfer Maps tool using a high-resolution and low-resolution plane. The high- resolution plane, on the left, has 18,342 polygon triangles. The low-resolution plane, on the right, has 72 triangles. In the Transfer Maps window, the Map Resolution is set to 512×512, the Maximum Value to 5, and the Sampling Quality to Medium (4×4). The Alpha Gain of the resulting displacement map’s file node is raised to 10. The Initial Sample Rate and Extra Sample Rate of the low-resolution surface are set to 20 and 10, respectively. 92730c13.indd 436 6/19/08 1:00:25 AM 437 ■ CREATING TEXTURES WITH THE TRANSFER MAPS TOOL High-resolution surface 18,342 triangles Displaced low-resolution surface 72 triangles Displacement map Figure 13.17 High-resolution surface compared to displaced low-resolution surface. This scene and map are included on the CD as displacement.ma and plane_map.tga. Baking Lighting and Shading Information You can “bake” lighting, texture, and shadow information with the Transfer Maps tool. In this situation, a textured source creates a color bitmap for a target surface. The Transfer Maps tool provides two attributes to choose from for this operation: Diffuse Color Map and Lit And Shaded Color Map. Diffuse Color Map simply cap- tures a source surface’s color without regard to lighting or shadows. Lit And Shaded Color Map captures all the source surface’s information, including specular high- lights, bump maps, ambient color textures, and so on (see Figure 13.18). You can map the resulting color bitmap to the low-resolution surface to reduce render times (by avoiding bump mapping, shadow casting, and the like). The use of Diffuse Color Map and Lit And Shaded Color Map attributes is identical to the creation of a displacement map or normal map. The Diffuse Color Map is activated with the Diffuse button, and the Lit And Shaded Color Map is activated with the Shaded button. High-resolution surface with multiple textures Low-resolution surface mapped with baked texture Baked texture Figure 13.18 A low-resolution surface is given detail with a baked texture. This scene and map are included on the CD as lit.ma and lit_map.tga. 92730c13.indd 437 6/19/08 1:00:40 AM 438 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ Managing Renders with the Render Layer Editor Render management is an inescapable part of animation production. Complex proj- ects can easily generate hundreds, if not thousands, of rendered images. The com- plexity is magnified when objects are rendered in separate passes or when shading components are addressed individually. Fortunately, Maya’s Render Layer Editor makes the task more efficient. Render Layer Overview The Layer Editor is accessible by clicking the Show The Channel Box And Layer Edi- tor icon on the status bar. The Layer Editor is composed of two sections, which you can toggle between by clicking the Display or Render radio button. The Display sec- tion of the Layer Editor is known as the Display Layer Editor. The Render section is known as the Render Layer Editor (see Figure 13.19). You can access the Render Layer Editor directly by choosing Window > Rendering Editors > Render Layer Editor. A) Renderable button. If blank, layer does not render. B) Recycle button. If green, layer does not re-render. If red, layer re-renders. If gray, layer has not rendered since le was opened. C) Shader icon. If gray, button opens the Hypershade. If blue, a material override is present and button will open the Attribute Editor tab for the override material. D) Flag icon. If gray, button opens the Attribute Editor tab for the Render Layer Editor and displays the Member Overrides and Render Pass Options sections. If red, an override is present. E) Controls icon. If gray, button opens default Render Settings window. If red, button opens overridden Render Settings window specic to the layer. F) Layer name. Blue indicates a selected layer. G) Blending mode drop-down menu. H) Create New Empty Layer button. I) Create New Layer And Assign Selected Objects button. D C B A G F E H I Figure 13.19 The Render Layer Editor By default, Maya places all objects on a master layer. The master layer is not visible in the Render Layer Editor until a new layer is created. To create a new layer and assign objects to that layer, you can choose one of these two approaches: C• hoose objects in the scene and click the Create New Layer And Assign Selected Objects button. 92730c13.indd 438 6/19/08 1:00:49 AM [...]... 13.34 There are many ways to approach any given render in Maya Although this book has demonstrated various methods, they are by no means the only approaches available Flexibility and resourcefulness are equally valuable assets when creating 3D I sincerely hope that Advanced Maya Texturing and Lighting, Second Edition inspires you to develop brand-new techniques chapter 13:   T e x t u r i n g a n d... network is exotic and difficult to access, instructions are included in the text Bonus Chapter An “Additional Techniques” chapter is included and contains advanced techniques that cover a wide range of topics Although none of the techniques is mandatory for successful animation, reading this chapter can strengthen your knowledge and allow you to be more flexible when solving lighting and texturing problems... of filters, color adjustments, opacities, and blending modes Each render pass received a different renderer and secondary rendering effect based on its contents and desired result While some passes used Global Illumination or Final Gather with mental ray, others relied on Maya Software Global Illumination proved to be the most effective with the mannequin and curtain, while Final Gather proved invaluable... stand-in object, converted with the Modify > Convert > Paint Effects To Polygons tool, and then arranged within the scene Once several basic hair “clumps” were created, in fact, they could be duplicated and overlapped to create greater complexity Each clump was created with the hairWetCurl Paint Effects brush with custom attribute settings to give it an appropriate amount of randomness, segments, and. .. illustration was created specifically for this book Since the amount of time available to create the render was limited, I combined standard lighting and texturing techniques with various shortcuts The model of the woman, known as Masha, was built by Andrey Kravchenko and is commercially available via www.turbosquid.com Masha’s polygon count, including clothing, is approximately 45,000 triangles For... Project_Files\Chapter_1\movies A  ppe n di x  ■ 454 Scene files and shading networks Background and HDR images Texture bitmaps Sample QuickTime movies The scene files included on the CD have been saved as Maya 8.5 ma files The files have been tested with versions 8.5 and 2008 In addition, all the techniques discussed in the book have been tested with versions 8.5 and 2008; any significant differences between the... for lighting, standard spot, directional, and ambient lights were employed (see Figure 13.28) Two spot lights illuminated the mannequin and represented the throw the prop spotlights An additional spot light served as a key A directional light created a rim and represented light arriving from the blue-green background Two ambient lights shared the duty as fill light Rim Fill 1 Spotlight 1 and 2 chapter... Texture tool, 165 backlights, 2 baking lighting and shading information, 437 baking, lighting and shading information, 437 Balance attribute, of Crater texture, 154 Ball projection style origin symbol, 163 for textures, 160, 160 The Band Wagon, 16 banding, 323 A Bar at the Foiles-Bergére (Manet), 19 baroque movement, 18 Barry Lyndon, 18 batch render, command line for, 318 Beer’s Law, 390 Bellows, George,... layer’s name in the Render Layer Editor Maya provides six special effect methods for combining layers These techniques are accessible through the Blend Mode drop-down menu (see Figure 13.19) The modes correspond to layer blend modes in Photoshop and include Normal, Lighten, Darken, Multiply, Screen, and Overlay For example, if three layers are activated with the R symbol and each layer has a different blend... including the renderer used For example, if a scene features a glass on a table, you can render the glass layer with mental ray and raytracing while rendering the table layer with Maya Software and no raytracing The master layer receives its render settings from default Common and renderspecific tabs of the Render Settings window However, once a new layer is created, the default Render Settings window . four tabs—Quality, Features, Passes, and Advanced (see Figure 13.14). 92730c13.indd 431 6/19/08 1:00:05 AM 432 c h a p t e r 13: TEXTURING AND LIGHTING WITH ADVANCED TECHNIQUES ■ Figure 13.14. materials, and effects in Maya, including depth-of-field, motion blur, raytracing, global illumination, caustics, subsurface scattering, HDR rendering, Maya Fur, Maya Hair, Paint Effects, and particles. In. maps can be written in any of the standard Maya image formats. Choose Map Height and Map Width values in the Maya Common Output section. Click the Bake And Close button at the bottom of the

Ngày đăng: 02/07/2014, 05:21

Tài liệu cùng người dùng

Tài liệu liên quan