Mastering Autodesk Maya 2011 phần 7 docx

105 305 1
Mastering Autodesk Maya 2011 phần 7 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

BuMP and norMal MaPPIng | 601 There are two types of normal maps, object space and tangent space: Object space maps These are used for nondeforming objects, such as walls, spaceships, trash cans, and the like. They are calculated based on the local object space of the object. Up in object space means toward the top of the object. If the object is rotated upside down in world space, the top is still the top—so a robot’s head is still the top of the object in object space even if it’s hanging upside down. Tangent space maps These are used for deforming objects, such as characters. Tangent space maps record the normal’s vector relative to the object’s surface. In tangent space, up means up away from the surface of the object. Tangent space maps appear more blue and purple since the direction in which the normal is being bent is always relative to the surface along the tangent space z-axis. The z-axis corresponds with the blue channel (XYZ = RGB). Object space maps, on the other hand, have more variation in color. In practice, most artists use tangent space maps for everything. In fact, prior to Maya 2008, tangent space maps were the only type of normal maps that Maya supported. Tangent space maps actually work well for both deforming and nondeforming objects. The most common way to create a normal map is to use a high-resolution, detailed version of the model as the source of the normal map and a low-resolution version of the model as the target for the map. The difference between the two surfaces is recorded in the colors of the map, which is then used to alter the appearance of the low-resolution model. This is a typical process when creating models for games where low-resolution models are required by the real-time ren- dering engine but the audience demands realistically detailed objects. Creating Normal Maps In this exercise, you’ll create a normal map for the giraffe. A high-resolution version of the model will be used as the source of the map. To create a normal map in Maya, you’ll use the Transfer Maps tool. This tool can be used to create a number of different texture map types, including normal maps. 1. Open the giraffeTransferMaps_v01.ma file from the chapter11\scenes folder of the DVD. 2. In the Display Layer panel, you’ll see two layers: one labeled LORES, the other HIRES. Turn off the LORES layer, and turn on the HIRES layer. You’ll see a higher- resolution detailed version of the giraffe, as shown in Figure 11.35. 3. Turn off the HIRES layer. The geometry does not need to be visible in order to extract maps, so if the high-resolution geometry is slowing down your computer, you can hide it. 4. Right-click the LORES layer, and choose Select Objects. 5. Under the Rendering menu set, choose Lighting/Shading  Transfer Maps to open the Transfer Maps interface (see Figure 11.36). 6. Expand the Target Meshes rollout. The loresGiraffe object is listed since it was selected when you opened the interface. If it does not appear, select it and click the Add Selected button. No other objects should be listed; if they are, select them in the list, and click the Remove Selected button. 602 | CHAPTER 11 texture MaPPIng Figure 11.35 The high-resolution giraffe Figure 11.36 The Transfer Maps interface BuMP and norMal MaPPIng | 603 7. Expand the Source Meshes rollout, right-click the HIRES layer, and choose Select Objects. 8. Click the Add Selected button to add it to the list. 9. Expand the Output Maps section; you’ll see icons representing all the different types of maps that can be created. 10. Click the Normal button to add normal map to the list. If other types of maps are listed, click the Remove Map button in the section for the map you want to remove. 11. Click the folder next to the Normal Map field, and set the location and filename for the location of the map that will be created. 12. Choose the sourceimages directory of the current project, and name the file giraffeHead_Nrml. There are a number of file format options to choose from. The two best choices are Maya IFF and EXR. Both are 32-bit formats that will ensure a detailed smooth map. 13. Choose EXR; this way you can open the map in Photoshop (CS1 and higher) for viewing if you need to. If the file format in the name of the file is something other than .exr, it will be automatically updated. Open EXR Loader Plug-in When using the EXR format in Maya, you’ll need to make sure the OpenEXRLoader plug-in is currently loaded; otherwise, you’ll get an error when you try to connect the file to a shader. Choose Window  Settings And Plug-ins  Plug-in Manager. In the list of plug-ins, make sure OpenEXRLoader.mll is currently selected. 14. The Include Materials check box is extremely useful if you want to include a bump map as part of the normal map. For now, deselect it since there is no bump map applied to the high-resolution mesh material. However, make a note of this option—you can add more detail to your normal map, such as pores and fine wrinkles, by applying a bump texture to the shader for the high-resolu- tion mesh object and then activating this option when using the Transfer Maps tool. Baking Bump Maps When baking a bump map into the normal map using the Include Materials option, the Bump Depth setting on the shader of the source mesh will determine the intensity of the bump as it’s baked into the normal map. If you need to change this later, you’ll need to adjust Bump Depth on the source mesh and rebake the normal map. 15. Set Map Space to Tangent Space. You should always use tangent space maps for charac- ters. Actually, as stated before, you can use them for any type of object. 604 | CHAPTER 11 texture MaPPIng 16. The Use Maya Common Settings check box makes the tool use the settings specified in the Maya Common Output. If this is deselected, sliders will appear that will allow you to set the size of the map in this section. For now, keep this box selected. 17. In the Connect Output Maps settings, you can connect the map to a shader automatically. Deselect the Connect Maps To Shader option for now. Later you’ll learn how to make the connection manually. Once you understand how the connection is made, you can use the Connect Maps To Shader option in the future to make things more convenient. 18. In the Maya Common Output settings, enter the following: a. Set the size of the map to 2048 in width and height. b. Set Transfer In to Object Space, and set Sampling Quality to High. c. Set Filter Size to 3. d. Set Filter Type to Gaussian. Leave Fill Texture Seams at 1 and the remaining three check boxes (Ignore Mirrored Faces, Flip U, and Flip V) deselected. Select Bake and Close to complete the tool. The settings are shown in Figure 11.37. Sometimes maps do not transfer properly. Errors usually look like solid pools of color. Often this is caused by the geometry not matching properly. To fix this, you can adjust the search enve- lope Maya uses to extract the differences between the models. The search envelope specifies the volume of space that Maya uses to search when creating the transfer map. Maya compares the target geometry (the low-resolution map) with the source geometry (the high-resolution map) and records the difference between the two as color values in the normal map. The search enve- lope sets the limits of the distance Maya will search when creating the map. The envelope itself is a duplicate of the target geometry that’s offset from the original. The offset distance is specified Figure 11.37 The transfer map’s options BuMP and norMal MaPPIng | 605 by the Search Envelope slider in the Target Meshes section of the Transfer Maps tool. What’s more, you can edit the Target Mesh geometry itself to improve the results of the final map. Use Low-Quality Settings When Testing Normal maps can take a while to calculate, so it’s a good idea to create a few test maps at lower quality and then raise the quality settings once you’re happy that the map is free of errors. You can bake out the rest of the UV shells by selecting each group and swapping their place- ment into the 0 to 1 texture space. Each group of shells is centered so you can snap the group to 0.5 and 0.5. Extending the grid helps keep things situated (see Figure 11.38). Some third-party applications like Mudbox read outside the 0 to 1 texture space and can transfer all the maps in one operation, instead of having to move the UV shell groups. When the maps are finished, you can close the scene without saving, since no adjustments were made. The next exercise takes you through the process of applying the normal maps. The Transfer In option has three choices: World Space, Object Space, and UV Space. These specify how the map will be calculated and transferred from the high-resolution version to the low-resolution version. If the models were different sizes, then the World Space option would be appropriate, and the models would need to be directly on top of each other. The objects used in this tutorial are the same size and very similar except for their resolutions and level of detail, so the Object Space option is more appropriate. The UV Space option works best for objects of fairly similar but not exactly the same shape, such as a female human character and a male human character. Figure 11.38 Extend the grid to keep the UV shell groups organized. 606 | CHAPTER 11 texture MaPPIng Applying Normal Maps Normal maps are applied to an object’s shader in the Bump channel, and they can be viewed in the perspective window. In this section, you’ll see how the map looks when it’s applied to the model as well as a few suggestions for fixing problems. 1. Open the giraffeUV_v07.ma file from the chapter11\scenes folder of the DVD. 2. Open the Hypershade window (Window  Rendering Editors  Hypershade). 3. Select the giraffe Head_Mat shader, and open its Attribute Editor. 4. Click the checkered box next to the Bump Mapping channel, and choose a file from the Create Render Node pop-up. 5. When you add the file node, the Attribute Editor will open to the bump2D node. Set the Use As option to Tangent Space Normals. This tells Maya the texture you’re applying is a normal map and not a bump map. You can leave the Bump Depth at 1; it has no effect on the strength of the normal map. 6. Switch to the file1 node, and click the folder next to the Image Name field. 7. Browse your computer’s file directory, and find the giraffeHead_Nrml.exr file; it should be in the sourceimages directory (if you get an error when loading the image, make sure the openEXRLoader plug-in is selected in the preferences). Once the file is loaded, you should see a preview in the texture sample icon. The texture should appear mostly blue and purple. If it is completely flat blue, then there was an error during the creation process—most likely the source mesh was not selected in the Transfer Maps options, so you’ll need to remake the map. 8. In the perspective view, choose High Quality Rendering from the Renderer menu at the top of the panel. After a few seconds, you should see a preview of the normal map in the perspective view. (Make sure you have Texture Shaded activated; press the 6 key to switch to this mode.) The normal map should make the low-resolution model look very similar to the high- resolution model. You can see in the silhouette of the geometry that the blockiness of the profile indicates that geometry is still low resolution, but those areas facing the camera look highly detailed. This workflow is very popular when creating models for games. The models end up looking much more realistic and detailed without taxing the processor of the game console. 9. Apply the rest of the maps in the same manner. Figure 11.39 shows the giraffe with all of its normal maps applied. 10. Inspect the model for errors in the texture. Most likely you’ll find some errors around the lips, ears, and eyes. If large portions of the model look wrong, you’ll need to try creating the map again. Sometimes just editing the geometry of the search envelope can fix the errors when you regenerate the map. Other times you may need to change the actual generation settings such as the Search Method and Max Search Depth values in the Advanced settings. dIsPlaCeMent MaPPIng | 607 Normal maps are difficult but not impossible to edit in a 2D paint program such as Photoshop. If the normal map has just a few small glitches, you can open them in Photoshop and paint each color channel (Red, Green, and Blue) separately to clean up the maps. This can be faster than trying to regenerate a whole new map just to fix a tiny spot. For a completed version of the scene, open the giraffeNormalMaps_v01.ma file from the chapter11\scenes folder on the DVD. Displacement Mapping Displacement maps are like bump maps in that they use a grayscale texture to add detail to a model. However, rather than just perturb the normal of the surface, displacement maps actu- ally alter the geometry at render time. Unlike normal and bump maps, the silhouette of the geometry reflects the detail in the map. Displacement maps can be used with NURBS, polygon, and subdivision surfaces and can be rendered in both mental ray and Maya Software. The best results are usually achieved by rendering displacement maps on a polygon surface in mental ray using mental ray’s Approximation Editor to subdivide the surface appropriately during render. Figure 11.39 The low-resolution model with all of its normal maps. 608 | CHAPTER 11 texture MaPPIng Viewing Displacements Displacement maps can be viewed only in a software render; they can’t be previewed in the per- spective window. Displacement maps are tricky to use and require some practice to master; however, the results are often worth the time invested. Recent advances in digital sculpting programs such as ZBrush and Mudbox have enabled modelers to bring an unprecedented amount of realism and detail to digital characters. The detail created in these high-density meshes is often brought into Maya in the form of displacement maps (and normal maps as well). In addition to aiding in creating detail on creatures, displacement maps have a wide variety of creative applications and innovations. You can use animated displacements to simulate roll- ing waves on an ocean surface, fissures opening in the earth, or veins crawling beneath the skin. In this section, you will apply displacement maps to the giraffe. Converting Displacement to Polygons If you decide you want actual geometry to be created from the displacement, you can convert the displacement to a polygon object. This might be helpful as a stand-in object if you need to position objects in the scene near the displaced plane or if you want to model terrain using a procedural texture. 1. Select the plane, and choose Modify  Convert  Displacement To Polygons. There are no options for this action. A second object will be created based on the original displaced plane. Any animation of the texture will not be reflected in the converted object; it derives its displacement from the current state of the displacing texture. 2. To increase the resolution of the converted object, increase the subdivisions in Height and Width on the original plane. The conversion will take longer to calculate, and the result- ing geometry will be denser. Displacement Maps for Characters Using displacement maps to add detail to characters is becoming increasingly common. This allows a low-resolution version of the model to be rigged and animated and then converted into a highly detailed mesh at render time. The end result can be quite spectacular. The render time involved, however, makes this workflow usable only for film and television; game engines are beginning to use displacements in real time but in a very limited capacity. Since a displacement map is a grayscale texture, it can be painted much like a bump map. A displacement map should be used for larger details that need to be seen in the silhouette of the geometry, such as large folds and wrinkles in the flesh, bumps on the nose, and large veins. Smaller details, such as pores, should be reserved for bump or normal maps that can be used in conjunction with displacement maps. Furthermore, with characters and complex objects, the geometry to be displaced should be fairly close in shape to the displaced version and have just enough subdivisions to allow for the additional detail. Maya’s Transfer Maps tool also allows for the creation of displacement maps. Generating a workable displacement map using this tool takes a little more work than if you used a third- party application, and it generally falls short of their precision. Through trial and error, you dIsPlaCeMent MaPPIng | 609 need to establish the proper displacement height. Second, the low-resolution geometry needs to be smoothed to avoid low-resolution shading (see Figure 11.40). In addition, do not use the .exr format to transfer the maps. The best format to use for transferring displacement maps is Maya’s native .iff format. The only difference between the settings in transferring normal maps and displacements is the Maximum Value attribute. This controls the range of values the displacement is gauged on. With the giraffe, a smaller value increases the contrast between low and high areas (see Figure 11.41). The best possible way to generate a displacement map for a character or creature is to use a digital sculpting program such as ZBrush or Mudbox. Although it involves learning another application, the results are excellent. This is becoming the workflow of choice for many major studios. When generating maps in a third-party application, it’s always best to create 32-bit Figure 11.40 This map was transferred with- out first smoothing the surface on the low-polygon version. Figure 11.41 The options used for transferring displacement 610 | CHAPTER 11 texture MaPPIng floating-point maps. This will ensure that the displacement is smooth and free of the stair- stepping artifacts that can appear in 16-bit maps. In this exercise, mental ray’s Approximation Editor is used to tessellate the geometry of the giraffe’s hind legs. 1. Open the giraffeDisp_v01.ma scene from the chapter11\scenes folder on the DVD. The giraffe has all of its UV texture coordinates set for applying the displacement maps. It is the same file used in applying normal maps except the materials have been changed to Blinns. 2. Select the giraffe, and create an approximation node. Choose Window  Rendering Editors  mental ray  Approximation Editor (if mental ray does not appear in the list, you’ll need to load the Mayatomr.mll plug-in using the Plug-in Manager). 3. In the Approximation Editor, click the Create button in the Subdivisions (Polygon And Subd. Surfaces) section. You do not need to create a displacement approximation node; the subdivision approximation provides enough geometry for displacement and smoothes the surface. 4. In the Attribute Editor for the mentalRaySubdivApprox1 node, do the following: a. Change the Approx Method set to Length/Distance/Angle. b. Set Max Subdivisions to 3. c. Set the Length to 0.01. This subdivides the model so the detail created by the displacement texture is more refined. Higher values allow more of the detail in the map to come through but also add more triangles. The Length/Distance/Angle efficiently adds triangles where they are needed the most. Figure 11.42 shows the settings. 5. Set the renderer to mental ray. Create a test render of the giraffe’s hind legs. It should look nice and smooth (see Figure 11.43). 6. In the Hypershade, select giraffeHindLegs_Mat, and choose Graph  Input And Output Connections, or click its icon. 7. Open Blinn2SG in the Attribute Editor. 8. Click the checkered box next to Displacement Mat. Figure 11.42 The settings used for the subdivision approximation node [...]... use Many of the connections that needed to be created manually in previous versions of Maya are now set up automatically when you create the shader There are several subsurface scattering shaders: misss_call_shader misss_fast_shader misss_fast_shader_x misss_fast_shader_x_passes misss_fast_simple _maya misss_fast_skin _maya misss_physical misss_set_normal misss_skin_specular With the exception of misss_physical,... giraffeHeadSSS_Mat again, and choose Graph Network You’ll see that Maya has automatically created the necessary light map and texture nodes (misss_fast_Imap _maya and mentalRayTexture1) If you select the mentalrayTexture1 node, you’ll see that the File Size Width and File Size Texture attributes are both | Subsurface Scattering â•… 6 17 highlighted in purple, indicating an expression is controlling their... ╇╉ scattering Chapter 12 Rendering for Compositing Maya offers a number of options for dividing the individual elements of a render into separate passes These passes can then be reassembled and processed with additional effects using compositing software, such as Adobe After Effects or Autodesk Composite In this chapter, you’ll learn how to use Maya s render layers and mental ray’s render passes to... MMB-drag mia_exposure_simple1 (you can see the full name if you hold the mouse pointer over the icon) down to the Lens Shader slot for studioCam (Figure€12 .7) Figure€12 .7 Attach the mia_ exposure_simple1 node to the Lens Shader slot of studioCam 7 In the Hypershade, select the mia_physicalsky1 node on the Utilities tab, and open its Attribute Editor to the mia_physicalsky1 tab 8 Right-click next to... subsurface scattering Some of the misss shaders are really combined versions of others For instance, misss_fast_skin _maya is actually a combination of misss_fast_shader and misss_skin_specular with an extra layer of subsurface scattering In this chapter, you’ll focus on using the misss_fast_skin _maya shader Misss Shaders The prefix misss stands for Mental Images Subsurface Scattering The misss_physical shader... the skin, bump, and displacement textures used in the previous section These same file textures (along with a few others) will be plugged into the skin shader (see Figure€11. 47) | Chapter 11â•…Texture Mapping 616â•… Figure€11. 47 The giraffe rendered without subsurface scattering 4 Open the Hypershade, and, on the left side, switch to the Create mental ray Nodes section 5 From the Materials section,... With Material from the marking menu All the assigned faces are selected 7 Right-click giraffeHeadSSS_Mat, and choose Assign Material To Selection from the marking menu The parts of the giraffe assigned to the SSS shader turn a solid color in the perspective view (depending on your graphics card, the color will vary), and that’s OK Maya just can’t preview some of the mental ray nodes using hardware rendering... and characters It takes practice to master, but the results are worth it Fast, Simple Skin Shader Setup In Maya there are several ways to create the look of subsurface scattering ranging from simple to complex The Translucence, Translucence Depth, and Translucence Focus sliders included on standard Maya shaders offer the simplest way to create translucency These sliders work fine for an object made of... on top of the shading group labeled misss_fast_skin _maya3 SG node, and choose Default These are the same displacement node, file texture, and settings created earlier in the chapter (see Figure€11.48) | Chapter 11â•…Texture Mapping 618â•… Figure€11.48 The shading network for the misss_fast_skin shader has several file textures connected to it 17 The scale of the giraffe is that 1 centimeter is equal... wax Likewise, the Scatter Radius slider and related attributes in the mental ray section of Maya shaders add a quick-and-dirty subsurface quality to simple objects However, these options fall far short when you’re trying to create a complex material such as human skin | Subsurface Scattering â•… 615 Since Maya 2008, the mental ray simple subsurface scattering shaders have become much easier to set . search enve- lope Maya uses to extract the differences between the models. The search envelope specifies the volume of space that Maya uses to search when creating the transfer map. Maya compares. object. 604 | CHAPTER 11 texture MaPPIng 16. The Use Maya Common Settings check box makes the tool use the settings specified in the Maya Common Output. If this is deselected, sliders will. artists use tangent space maps for everything. In fact, prior to Maya 2008, tangent space maps were the only type of normal maps that Maya supported. Tangent space maps actually work well for both

Ngày đăng: 09/08/2014, 11:21

Từ khóa liên quan

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

  • Đang cập nhật ...

Tài liệu liên quan