Mastering Autodesk Maya 2011 phần 6 pptx

105 230 0
Mastering Autodesk Maya 2011 phần 6 pptx

Đ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

496 | CHAPTER 9 lIghtIng WIth Mental ray 18. The Caustics settings are similar to the Global Illumination settings. In the spotlight’s Attribute Editor, lower Photon Intensity to 3000. Set Caustic Photons to 80000. You can adjust the color of the caustic highlight by changing the caustic photon color or by changing the color of the transparency on the crystal shader. It’s probably a better idea to change the transparency color on the shader; that way, if one light is creating Caustics on two different objects that are shaded with different colors, the color of the caustic pho- tons won’t clash with the color of the objects. The Exponent setting for Caustics works just like the Exponent setting for Global Illumination. 19. Select the crystal object, and open the Attribute Editor. 20. Click the Crystal Shade tab. Set the Transparency color to a light pink. 21. Open the Render Settings window, and click the Indirect Lighting tab. Set Accuracy of the Caustics to 32. 22. Create a test render of the scene (Figure 9.24). Figure 9.23 The image on the left is rendered without Caustics enabled; the image on the right has Caustics enabled. Figure 9.24 The scene is ren- dered after lower- ing the Accuracy and the Photon Intensity settings. IndIreCt lIghtIng: gloBal IlluMInatIon | 497 A lower Accuracy value produces sharper caustic highlights at the risk of some graininess. A higher value removes the grainy quality but softens the look of the caustics. You can also soften the look a little by setting Filter to Cone. The Radius value can be left at 0 if you want Maya to determine the proper radius at render time. Settings less than 1 make individual photons more visible. The Merge Distance setting merges all photons within the specified distance, which can decrease render times but remove the detail in the caustic patterns. Caustic Light Setup In practice, spotlights are usually the best choice for creating Caustics. Area lights don’t work nearly as well. The cone angle of the spotlight is reduced, so no photons are wasted; they are concentrated on the globe and stand. However, you may not want the visible edge of the spot- light cone on the floor. To fix this, you can use two spotlights—one to create the caustic photons and the other to light the scene. 1. Select the spotlight, and duplicate it (Ctrl+d). 2. Open the Attribute Editor for spotlight1: a. Under Spotlight Attributes, turn off Emit Diffuse. b. Under Shadows, turn off Use Ray Trace Shadows. 3. Select spotlight2, and open its Attribute Editor. Under Spotlight Attributes, turn off Emit Specular. 4. Set Cone Angle to 90. 5. Turn off Emit Photons under Caustics And Global Illumination. 6. Create a test render of the scene. The scene looks pretty much the same, but the area of light cast by the spotlight has been widened. 7. In the Outliner, select the Stand group, and apply a Blinn shader. Name the shader standShader. 8. Open the Attribute Editor for the standShader: a. Set Color to a light, bright yellow. b. Set Diffuse to 0.25. 9. Under Specular Shading, apply the following settings: Eccentricity: 0.1 Specular Roll Off: 1 Specular Color: white Reflectivity: 0.85. 10. Create another test render. You can clearly see the light reflected off the stand and onto the floor (see Figure 9.25). 11. Save the scene as crystalGlobe_v02.ma. 498 | CHAPTER 9 lIghtIng WIth Mental ray When working with Caustics, you’ll get more interesting results when the caustic light pat- terns are created from complex objects. You’ll also find that the patterns created by transparent objects vary greatly when you change the Refractive Index value of the transparent shader. To see a version of the scene to this point, open the crystalGlobe_v02.ma scene from the chapter9\scenes directory on the DVD. Indirect Illumination: Final Gathering Final Gathering is another method for calculating indirect lighting. It can be used on its own or in conjunction with Global Illumination. Final Gathering uses irradiance sampling and ambient occlusion to create the look of ambient and indirect lighting. When Final Gathering is enabled, rays are cast from the camera into the scene. When a ray intersects with a surface, a Final Gathering point is created that samples the irradiance value of the surface and how it is affected by other scene elements, such as nearby objects, lights, and light-emitting surfaces. Final Gathering uses ray tracing rather than photon casting. Each Final Gathering point that the camera shoots into the scene lands on a surface and then emits a number of Final Gathering primary rays, which gather information about the irradiance values and proximity of other scene elements. The information gathered by the rays is used to determine the shading of the surface shading normal at the location of the Final Gathering point. Imagine a hemispherical dome of rays that are emitted from a point on a surface; the rays gather information about other surfaces in the scene. Like Global Illumination, this allows it to simulate color bleeding from nearby surfaces. Figure 9.25 Apply a reflec- tive shader to the stand, creating intricate patterns of reflected light on the floor. IndIreCt IlluMInatIon: FInal gatherIng | 499 Light-Emitting Objects One of the most interesting aspects of Final Gathering is that you can use objects as lights in a scene. An object that has a shader with a bright incandescent or ambient color value actually casts light in a scene. This works particularly well for situations in which geometry needs to cast light in a scene. For example, a cylinder can be used as a fluorescent lightbulb (Figure 9.26). When a shader is assigned to the cylinder with a bright incandescent value and Final Gathering is enabled, the result is a very convincing lighting scheme. In this exercise, you’ll light a three-wheeled car designed by Anthony Honn using only objects with incandescent shaders. Polygon planes will be used as so-called light cards to simu- late the look of diffuse studio lighting. You’ll find that it’s easy to get a great-looking result from Final Gathering rendering while still using very simple, standard Maya shaders. 1. Open the car_v01.ma scene from the chapter9\scenes directory on the DVD. 2. Open the Render Settings window, and click the Common tab. 3. Scroll to the bottom of the window, and expand the Render Options rollout. Make sure the Enable Default Light option is not checked. The Enable Default Light option is normally on so that when you create a test render in a scene with no lights, you can still see your objects. When you add a light to the scene, the default light is overridden and should no longer illuminate the objects in the scene. However, since you won’t be using actual lights in this scene, you need to deselect Enable Default Light. Figure 9.26 A cylinder with an incandescent shader actually casts light in the scene when Final Gathering is enabled. 500 | CHAPTER 9 lIghtIng WIth Mental ray 4. Click the Quality tab, and set Quality Presets to Production. 5. Create a quick test render using the renderCam camera. The scene should appear com- pletely black, confirming that no lights are on in the scene. 6. Switch to the Indirect Lighting tab, scroll down, and activate Final Gathering. 7. Do another test render. The scene should still be black. 8. Select the renderCam camera in the Outliner, and open its Attribute Editor. 9. Switch to the renderCamShape tab, scroll down to the Environment section, and set Background Color to white. 10. Create another test render. Make sure the renderCam is chosen as the rendering camera. You’ll see the car appear as the scene renders. There are no lights in the scene. However, the white color of the background is used in the Final Gathering calculations. You’ll notice that the scene renders twice. The Final Gathering render takes place in two stages: a. In the first pass, Final Gathering projects rays from the camera through a hexagonal grid that looks like a low-resolution version of the image. b. In the second stage, the Final Gathering points calculate irradiance values, and the image is actually rendered and appears at its proper quality. You’ll often notice that the first pass appears brighter than the final render. The car has a simple white Lambert shader applied. The shadowing seen under the car and in the details is an example of ambient occlusion that occurs as part of a Final Gathering render (Figure 9.27). 11. Set Background Color of the renderCam to black. 12. Create a polygon plane, and apply a Lambert shader to the plane. 13. Set the Incandescence of the plane’s Lambert shader to white. Figure 9.27 The car is rendered with no lights in the scene. The background color is used to calculate the Final Gather- ing points. IndIreCt IlluMInatIon: FInal gatherIng | 501 14. Use the Move and Rotate tools to position the plane above the car at about a 45-degree angle. Use the following settings in the Channel Box for the plane: Translate X: 431 Translate Y: 25.793 Translate Z: 14.072 Rotate X: 45 Rotate Y: 0 Rotate Z: 0 Scale X: 40 Scale Y: 20 Scale Z: 20 15. Select the plane, and open the Attribute Editor to the pPlaneShape2 tab. 16. Expand the Render Stats rollout, and turn off Primary Visibility. This means that the plane still influences the lighting in the scene and can still be seen in reflections and refractions, but the plane itself is not seen by the rendering camera. 17. Create another test render from the renderCam. The car appears much darker this time. 18. Select the pPlane2 shape, and open the Attribute Editor. 19. Select the tab for the plane’s Lambert shader, and click the swatch next to Incandescence to open the Color Chooser. 20. Set the slider mode to HSV using the menu below the Color Chooser. Set the value slider (V) to 4. 21. Create another test render. The car should be more visible now (Figure 9.28). Figure 9.28 Raising the value of the incandescence on the shader’s plane makes the car more visible. 502 | CHAPTER 9 lIghtIng WIth Mental ray Using incandescent objects is a great way to simulate the diffuse light boxes used by pho- tographers. You can easily simulate the lighting used in a studio by strategically placing incandescent planes around the car. However, you’ll notice that the lighting is somewhat blotchy. You can fix this using the Final Gathering settings on the Indirect Lighting tab of the Render Settings window. The Final Gathering options in the render settings set the global quality of the Final Gathering render. Here is a brief description of what these settings do: Accuracy This value determines the number of Final Gathering rays shot from the cam- era. Higher values increase render time. A value of 100 is fine for testing; a high-quality render typically uses 500 to 800 rays. Point Density This setting determines the number of Final Gathering points generated by the rays. Increasing this value also increases quality and render time. Point Interpolation This setting smoothes out the point calculation. Increasing this val- ue improves the quality of the result without adding too much to render time. However, as with any smoothing operation, detail can be lost at higher values. Primary Diffuse Scale Just like with Global Illumination and Caustics, this scale brightens the resulting Final Gathering render. Secondary Diffuse Bounces Enabling this option allows Final Gathering rays to bounce off a second diffuse surface before terminating. This increases realism as well as render time. Final Gathering rays do most of their work on the first or second bounce; beyond that, the calculations don’t yield a significant difference. Secondary Diffuse Scale Increasing the value of Secondary Diffuse Scale increases the influence of the Secondary Diffuse Bounces. Per-Surface Final Gathering Settings Individual surfaces can have their own Final Gathering settings located in the mental ray rollout in the surface’s shape node. These settings will override the render settings and can be used as needed for optimizing renders. 22. Set Accuracy to 400, Point Density to 2, and Secondary Diffuse Bounces to 1. 23. In the Outliner, expand the Car group. Select the leftBody, and Ctrl+click the rightBody. 24. Open the Hypershade, and assign the metal shader to these two groups. 25. Create another test render (Figure 9.29). The white polygon is reflected in the surface of the car. The shader that is applied to the body is a very simple Phong-type shader, and it looks pretty good. 26. Save the scene as car_v02.ma. To see a version of the scene to this point, open the car_v02.ma scene from the chapter9\ scenes directory on the DVD. IndIreCt IlluMInatIon: FInal gatherIng | 503 Final Gathering Maps Setting the Rebuild option to Off causes mental ray to reuse any saved Final Gathering maps generated from previous renders. This saves a great deal of time when creating a final render. However, if the camera is moving and Final Gathering requires additional points for interpola- tion, new points are generated and appended to the saved map. When Rebuild is set to Freeze, the scene is rendered with no changes to the Final Gathering map regardless of whether the scene requires additional points. This reduces flickering in ani- mated sequences, but you need to make sure the scene has enough Final Gathering points gen- erated before using the Freeze option. Neon Lights For several commercial projects I have created convincing neon lights using light-emitting objects; an example is shown here. By adding a glow effect to my incandescent shaders and rendering with Final Gathering, the neon lights can look very realistic. This is my technique for creating this effect: 1 . Create a series of curves to build the neon light geometry. Shape them into letters or decorative elements. 2 . Apply a Paint Effects brush to the curves to build the neon tubes. Figure 9.29 Apply a reflective material to the body, enhancing the realism of the lighting. (CONTINUES) 504 | CHAPTER 9 lIghtIng WIth Mental ray Neon Lights (CONTINUED) 3 . Convert the brush strokes into NURBS or polygon geometry. 4 . Apply a Blinn shader to the neon tube geometry. In the incandescence channel of the shader, add a ramp texture. 5 . To make the center of the tube brighter than the edges, connect a Sampler Info node to the ramp. Use the Connection Editor to connect the Facing Ratio attribute of the Sampler Info node to the V Coordinate attribute of the ramp. Make sure the ramp is set to V Ramp. 6 . Edit the ramp so the top of the ramp (which corresponds to the center of the neon tube) is brighter than the bottom of the ramp (which corresponds to the edges of the neon tube). 7 . In the Special Effects rollout of the shader, increase the Glow Intensity setting. A value of 0.1 should be sufficient. 8 . In the Hypershade, select the shaderGlow1 node, and open its Attribute Editor. Turn off Auto Exposure. This eliminates flickering problems that may occur if the scene is animated. 9 . Turning off Auto Exposure causes the glow effect to be overly bright. In the Glow Attributes section of the shaderGlow node, lower the Glow Intensity setting. Finding the proper value takes some experimentation on a number of test renders. There is only one shaderGlow node for each Maya scene. This node applies the same settings to all the glowing objects within a scene. The glow effect is a post-process effect, so you won’t see the glow applied in the render until all the other parts of the image have been rendered. 1 0 . In the Render Settings window, make sure Renderer is set to mental ray. 1 1 . In the Indirect Lighting tab, turn on Final Gathering. 1 2 . Click the swatch next to Primary Diffuse Scale to open the Color Chooser. Raise the Value above 1. A setting between 2 and 4 should be sufficient. Surfaces near the neon tubes should have a high diffuse value so they reflect the light emitted by the tubes. To see an example of neon lighting using Final Gathering, open the vegas.ma scene from the chapter9\scenes directory on the DVD. IndIreCt IlluMInatIon: FInal gatherIng | 505 If a scene has an animated camera, you can generate the Final Gathering map by rendering an initial frame with Rebuild set to On, moving the Time slider until the camera is in a new position, and then setting Rebuild to Off and rendering again. Repeat this procedure until the path visible from the camera has been sufficiently covered with Final Gathering points. Then create the final render sequence with Rebuild set to Freeze. This short exercise demonstrates this technique. 1. Open the car_v03.ma scene from the chapter9\scenes directory on the DVD. In this scene, a camera named FGCam is animated around the car. The first 10 frames of the animation have been rendered using Final Gathering. In the Final Gathering Map section of the Render Settings window, the Rebuild attribute is set to On, so new Final Gathering points are calculated with each frame. 2. View the rendered sequence by choosing File  View Sequence. The 10-frame sequence is found in the chapter9\images directory on the DVD. The sequence is labeled carFG_test1. You can clearly see flickering in this version of the animation. 3. In the Final Gathering Map section, turn on Enable Map Visualizer. Set the timeline to frame 1, and create a test render using the FGCam camera. 4. When the render is complete, switch to the perspective view. In the viewport window, disable NURBS Surfaces, and disable Polygons in the Show menu. You can clearly see the Final Gathering points outlining the surface of the car. Notice there are no points on the surfaces that have the metal texture applied. This is because they are reflective surfaces with a very low diffuse value—remember that Final Gathering is used for rendering diffuse surfaces, such as the surfaces with the white Lambert shader applied (see Figure 9.30). 5. In the Render Settings window, set Rebuild to Off. Set the timeline to 4, and create another test render using the FGCam camera. You’ll notice it takes less time to render, and the display of the Final Gathering points in the perspective view is updated. More points have been added to correspond with the FGCam’s location on frame 4. The Final Gathering points are saved in a file named default.fgmap. Figure 9.30 The Final Gather- ing points are vis- ible in the scene after creating a test render. [...]... from the chapter9\scenes directory on the DVD | Chapter 9â•…Lighting with mental ray 5 16 •… 2 Create an area light (Create  Lights  Area Light) Position the light using the following settings: Translate X: 14.3 86 Translate Y: 30.2 86 Translate Z: -27. 862 Rotate X: -90 Scale X: 6. 718 Scale Y: 9.095 Scale Z: 4 .63 9 3 In the Attribute Editor under the areaLightShape1 heading, turn Enable Ray Traced... rendering with mental ray This chapter will discuss some aspects of working with the standard Maya shaders, but for the most part it will focus on the most often used mental ray shaders If you are unfamiliar with the standard shaders, we recommend you review the Maya documentation or read Introducing Maya 2011 by Dariush Derakshani (Sybex, 2010) 530â•… | Chapter 10â•…mental ray Shading Techniques...| Chapter 9â•…Lighting with mental ray 5 06 •… 6 Make three more test renders from frames 6, 8, and 10 7 Render a sequence of the first 10 frames of the animation, and compare this to the carFG_test1 sequence You can also view the carFG_test2 sequence in the chapter9\... rollout, activate Use Light Shape, and create another test render (See Figure€9. 36) Figure€9. 36 The mental ray area light is enabled when Use Light Shape is activated in the Attribute Editor | mental ray Area Lights â•… 517 The new render is less blown out, and the shadows are much softer (although still grainy) Unlike standard Maya area lights, the intensity of mental ray area lights is not affected by... kitchen_v 06. ma scene from the chapter9\scenes directory on the DVD Figure€9.38 The shape of the spotlight creates shadows based on the area light settings Light Shaders mental ray has a number of light shaders that can be applied to lights in a scene The purpose of these shaders is to extend the capabilities of Maya lights to allow for more lighting options When a mental ray shader is applied to a Maya. .. enough information in this chapter to give the everyday Maya user a variety of options for shading and rendering using mental ray If you decide that you’d like to delve deeper into more advanced techniques, we recommend reading the mental ray shading guide that is part of the Maya documentation, as well as Boaz Livny’s excellent book mental ray for Maya, 3ds Max, and XSI (Sybex, 2008) Before starting... fundamentals that are important to understand before you start working with the shaders in a scene | Shading Concepts â•… 529 Maya Standard Shaders and mental ray Materials The Maya standard shaders are found in the left list in the Hypershade window when you click the Surface heading under Maya (as shown here) The most often used standard shaders are Blinn, Lambert, Phong, Phong E, and Anisotropic You can... standard 8-bit or 16- bit image file, such as a TIFF An HDR image is a 32-bit floating-point format image that stores multiple levels of exposure within a single image Both 8-bit and 16- bit image formats store their color values as integers (whole numbers), while a 32-bit floating-point file can store colors as fractional values (numbers with a decimal) This means that the 8-bit and 16- bit formats cannot... in a way that the software understands In Maya, the Hypershade provides you with a graphical user interface so you can edit and connect shaders without writing or editing the text files themselves 528â•… | Chapter 10â•…mental ray Shading Techniques The terms shader and material are synonymous; you’ll see them used interchangeably through the book and the Maya interface mental ray also uses shaders... mental ray is a rendering plug-in that is included with Maya It is a professional-quality photoÂ� realistic renderer used throughout the industry in film, television, architectural visualization, and anywhere photorealism is required Learning mental ray takes time and practice Even though it’s a plug-in, you’ll find that it is as deep and extensive as Maya itself mental ray includes a library of custom . vis- ible in the scene after creating a test render. 5 06 | CHAPTER 9 lIghtIng WIth Mental ray 6. Make three more test renders from frames 6, 8, and 10. 7. Render a sequence of the first 10 frames. standard 8-bit or 16- bit image file, such as a TIFF. An HDR image is a 32-bit floating-point format image that stores multiple levels of exposure within a single image. Both 8-bit and 16- bit image formats. view and use OpenEXR images in Maya, you’ll need to enable the openEXRLoader.mll plug-in. It should be on by default, but occasionally it does not load when you start Maya. To load this plug- in,

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