1. Trang chủ
  2. » Công Nghệ Thông Tin

Mastering Autodesk Maya 2011 phần 8 docx

105 187 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 105
Dung lượng 3,08 MB

Nội dung

706 | CHAPTER 13 IntroduCIng nPartICles 4. Switch to a side view, and turn on wireframe mode. 5. Play the animation, and observe the behavior of the nParticles. If you look at the Collisions settings for moltenMetal, you’ll see that the Self Collide attri- bute is off, but the nParticles are clearly colliding with each other. This type of collision is part of the liquid behavior defined by the Incompressibility attribute (this is discussed a little later in the chapter). 6. Play the animation back several times; notice the behavior when A. Enable Liquid Behavior is off. B. Self Collide is on (set Self Collide Width Scale to 0.7). C. Both Liquid Behavior and Self Collide are enabled. 7. Turn Liquid Behavior back on, and turn Self Collide off. 8. Open the Particle Size rollout panel, and set Radius to 0.25; play the animation. There seems to be much less fluid for the same number of particles when the radius size is lowered. 9. Play the animation for about 140 frames until all the nParticles settle. 10. With the moltenMetal shape selected, choose nSolvers  Initial State  Set From Current. 11. Rewind and play the animation; the particles start out as settled in the well of the tub (see Figure 13.27). 12. Select moltenMetal. At the top of the Attribute Editor, deselect Enable to temporarily disable the nParticle simulation so you can easily animate the tub. 13. Select the tub1 group in the Outliner, and switch to the side view. 14. Select the Move tool (hot key = w). Hold the d key on the keyboard, and move the pivot for tub1 so it’s aligned with the center of the handles that hold it in the frame (see Figure 13.28). 15. Set the timeline to frame 20. 16. In the Channel Box, select the Rotate X channel for the tub1 group node, right-click, and set a keyframe. 17. Set the timeline to frame 100. 18. Set the value of tub1’s Rotate X channel to 85, and set another key. Figure 13.27 Setting Initial State makes the nParticles start out from their settled position. usIng nPartICles to sIMulate lIquIds | 707 19. Move the timeline to frame 250, and set another keyframe. 20. Set the timeline to 330, set Rotate X to 0, and set a fourth key. 21. Select moltenMetal, and in the Attribute Editor, select the Enable check box. 22. Rewind the animation, and play it. The nParticles pour out of the tub like water (see Figure 13.29). Figure 13.28 Align the pivot point for the tub group with the handles from the side view. Figure 13.29 When you animate the tub, the nParticles pour out of it like water. 708 | CHAPTER 13 IntroduCIng nPartICles 23. Switch to the perspective view. When you play the animation, the water goes through the bucket and the floor. 24. Select the bucket, and choose nMesh  Create Passive Collider. 25. Switch to the nucleus1 tab, and turn on Use Plane. 26. Set the PlaneOrigin’s Translate Y to -4.11 to match the position of the floor. Now when you play the animation, the nParticles land in the bucket and on the floor. Set the Collision Flag to Edge You can improve the performance speed of the playback by selecting the nRigid node connected to the bucket and setting Collision Flag to Edge instead of Face. 27. By default the liquid simulation settings approximate the behavior of water. To create a more molten metal–like quality, increase Viscosity to 10. Viscosity sets the liquid’s resis- tance to flow. Sticky, gooey, or oily substances have a higher viscosity. Viscosity and Solver Substeps Increasing the number of substeps on the Nucleus solver will magnify viscosity. 28. Set Liquid Radius Scale to 0.5. This sets the amount of overlap between nParticles when Liquid Simulation is enabled. Lower values create more overlap. By lowering this setting, the fluid looks more like a cohesive surface. You can use the other settings in the Liquid Simulation rollout panel to alter the behavior of the liquid: Incompressibility This setting determines the degree to which the nParticles resist compression. Most fluids use a low value (between 0.1 and 0.5). If you set this value to 0, all the nParticles will lie at the bottom of the tub in the same area, much like a nonliquid nParticle with Self Collide turned off. Rest Density This sets the overlapping arrangement of the nParticles when they are at rest. It can affect how “chunky” the nParticles look when the simulation is running. The default value of 2 works well for most liquids, but compare a setting of 1 to a setting of 5. At 1 fewer nParticles overlap, and they flow out of the tub more easily than when Rest Density is set to 5. Surface Tension The Liquid Simulation settings now have a Surface Tension slider in Maya 2011. Surface tension simulates the attractive force within fluids that tends to hold them together. Think of how a drop of water forms a surface as it rests on wax paper or how beads of water form when condensing on a cold pipe. usIng nPartICles to sIMulate lIquIds | 709 29. To complete the behavior of molten metal, set Rest Density to 2, and set Incompressibility to 0.5. 30. In the Collisions rollout panel, set Friction to 0.5 and Stickiness to 0.25. 31. Expand the Dynamic Properties rollout panel, and increase Mass to 6. Note that you may want to reset the initial state after changing the settings because the nParticles will now collapse into a smaller area (see Figure 13.30). 32. Save the scene as forge_v03.ma. To see a version of the scene to this point, open forge_v03.ma from the chapter13\scenes folder. Viscosity Scale and Surface Tension Ramp In Maya 2011, you can now fine-tune the behavior of your liquid simulations using Viscosity Scale and Surface Tension ramps. You can use the viscosity scale to modify the viscosity over time. To do this, set Viscosity Scale Input to Age, and adjust the ramp. You can also use other inputs such as Randomized ID and Radius to determine how viscosity is applied to the liquid. The Surface Tension Scale Ramp setting allows you to scale the surface tension value based on an input such as the age of the particle, a randomized ID, the radius, and more using settings similar to the other ramps. Converting nParticles to Polygons You can convert nParticles into a polygon mesh. The mesh updates with the particle motion to create a smooth blob or liquid-like appearance, which is perfect for rendering fluids. In this Figure 13.30 Adjusting the settings under Liquid Simulation, Collisions, and Dynamic Proper- ties makes the nParticles behave like a heavy, slow- moving liquid. 710 | CHAPTER 13 IntroduCIng nPartICles section, you’ll convert the liquid nParticles created in the previous section into a mesh to make a more convincing molten metal effect. 1. Continue with the scene from the previous section, or open the forge_v03.ma scene from the chapter13\scenes folder on the DVD. 2. Play the animation to about frame 230. 3. Select the moltenMetal object in the Outliner, and choose Modify  Convert  nParticle To Polygons. The nParticles have disappeared, and a polygon mesh has been added to the scene. You’ll notice that the mesh is a lot smaller than the original nParticle simulation; this can be changed after converting the nParticle to a mesh. You can adjust the quality of this mesh in the Attribute Editor of the nParticle object used to generate the mesh. 4. Select the new polySurface1 object in the Outliner, and open the Attribute Editor to the moltenMetalShape tab. 5. Expand the Output Mesh section. Set Threshold to 0.8 and Blobby Radius Scale to 2.1. Fine-Tuning the Mesh The settings in step 5 smooth the converted mesh. Higher Threshold settings create a smoother but thinner mesh; increasing Blobby Radius Scale does not affect the radius of the original nParticles. Rather, it uses this value as a multiple to determine the size of the enveloping mesh around each nParticle. Using the Threshold and Blobby Radius Scale settings together, you can fine-tune the look of the converted mesh. 6. Set Motion Streak to 0.5. This stretches the moving areas of the mesh in the direction of the motion to create a more fluid-like behavior. 7. Mesh Triangle Size determines the resolution of the mesh. Lowering this value increases the smoothness of the mesh but also slows down the simulation. Set this value to 0.3 for now, as shown in Figure 13.31. Once you’re happy with the overall look of the animation, you can set it to a lower value. This way, the animation continues to update at a reason- able pace. Figure 13.31 Adjust the quality of the mesh in the Output Mesh section of the nParticle’s shape node attributes. usIng nPartICles to sIMulate lIquIds | 711 Max Triangle Resolution sets a limit on the number of triangles used in the nParticle mesh. If the number is exceeded during the simulation, Max Triangle Size is raised automatically to compensate. Adjust Max Triangle Size Numerically Be careful when using the slider for Mesh Triangle Size. It’s easy to move the slider to a low value by accident, and then you’ll have to wait for Maya to update, which can be frustrating. Use numeric input for this attribute, and reduce the value by 0.05 at a time until you’re happy with the look of the mesh. Use Gradient Normals smoothes the normals of the mesh. Mesh Method determines the shape of the polygons that make up the surface of the mesh. The choices are Cubes, Tetrahedra, Acute Tetrahedra, and Quad Mesh. After setting the Mesh Method option, you can create a smoother mesh around the nParticles by increasing the Max Smoothing Iterations slider. For example, if you want to create a smoother mesh that uses four- sided polygons, set Mesh Method to Quads, and increase the Max Smoothing Iterations slider. By default, the slider goes up to 10. If a value of 10 is not high enough, you can type values greater than 10 into the field. Shading the nParticle Mesh To create the look of molten metal, you can use a simple Ramp shader as a starting point. 1. Select the polySurface1 node in the Outliner. Rename it metalMesh. 2. Right-click the metalMesh object in the viewport. Use the pop-up menu to assign a ramp material. Choose Assign New Material. A pop-up window will appear; choose Ramp Shader from the list (see Figure 13.32). Figure 13.32 Assign a Ramp shader to the metalMesh object. 712 | CHAPTER 13 IntroduCIng nPartICles 3. Open the Attribute Editor for the new Ramp shader. In the Common Materials Attributes section, set Color Input to Facing Angle. 4. Click the color swatch, and use the Color Chooser to pick a bright orange color. 5. Click the right side of the ramp to add a second color. Make it a reddish orange. 6. Create a similar but darker ramp for the Incandescence channel. Ramp Shader Color Input Settings Each of the color channels that uses a ramp will use the same Color Input setting as the Color rollout panel. So, in the case of this ramp, Incandescence will also use Facing Angle as the input. 7. Set Specularity to 0.24 and the specular color to a bright yellow. 8. Increase the Glow intensity in the Special Effects rollout panel to 0.15. 9. Back in the moltenMetal particle Attribute Editor, decrease the Mesh Triangle Size to 0.1 (it will take a couple minutes to update), and render a test frame using mental ray. Set the Quality preset on the Quality tab to Production. 10. Save the scene as forge_v04.ma. To see a version of the finished scene, open forge_v04.ma from the chapter13\scenes folder on the DVD (see Figure 13.33). Emit nParticles Using a Texture The behavior of nParticles is often determined by their many dynamic properties. These control how the nParticles react to the settings in the Nucleus solver as well as fields, collision objects, Figure 13.33 Render the molten metal in mental ray. eMIt nPartICles usIng a texture | 713 and other nParticle systems. In the following section, you’ll get more practice working with these settings. If you have used standard particle systems in previous versions of Maya, you’ll be pleased to see how, since 2009, Maya has streamlined the workflow for creating particle effects. Many of the attributes that required custom connections, expressions, and ramps are now automated. Surface Emission In this exercise, you’ll use nParticles to create the effect of flames licking the base of a space cap- sule as it reenters the atmosphere. You’ll start by emitting nParticles from the base of the capsule and use a texture to randomize the generation of the nParticles on the surface. 1. Open the capsule_v01.ma scene from the chapter13\scenes directory on the DVD. You’ll see a simple polygon capsule model. The capsule is contained in a group named spaceCapsule. In the group there is another surface named capsule emitter. This will serve as the surface emitter for the flames (see Figure 13.34). Creating an Emitter Surface from a Model The capsule emitter geometry was created by selecting the faces on the base of the capsule and duplicating them (Edit Mesh  Duplicate Face). A slight offset was added to the duplicate face operation to move it away from the capsule surface. The idea is to have the nParticles generated by the bottom of the capsule. By creating an object separate from the bottom of the model, you can make the process much easier and faster. Figure 13.34 The capsule group consists of two polygon meshes. The base of the cap- sule has been dupli- cated to serve as an emitter surface. 714 | CHAPTER 13 IntroduCIng nPartICles 2. Play the animation. The capsule has expressions that randomize the movement of the capsule to make it vibrate. The expressions are applied to the Translate channels of the group node. To see the Expressions, do the following: a. Open the Expression Editor (Window  Animation Editors  Expression Editor). b. Choose Select Filter  By Expression Name. c. Select expression1, expression2, or expression3. You’ll see the expression in the box at the bottom of the editor (see Figure 13.35). 3. In the viewport, choose to look through the renderCam. The camera has been set up so the capsule looks as though it’s entering the atmosphere at an angle. 4. In the Outliner, expand the spaceCapsule, and choose the capsuleEmitter object. 5. Switch to the nDynamics menu set, and choose nParticles  Create nParticles  Points to set the nParticle style to Points. 6. Select the capsuleEmitter, and choose nParticles  Create nParticles  Emit From Object  Options. 7. In the options, choose Edit  Reset to clear any settings that remain from previous Maya sessions. 8. Set Emitter Name to flameGenerator. Set Emitter Type to Surface and Rate (particles/sec) to 150. Leave the rest of the settings at the default, and click the Apply button to create the emitter. 9. Rewind and play the animation. The nParticles are born on the emitter and then start falling through the air. This is because the Nucleus solver has Gravity activated by default. For now this is fine; leave the settings on the Nucleus solver where they are. Figure 13.35 Create the vibra- tion of the capsule using random function expres- sions applied to each of the transla- tion channels of the capsule. eMIt nPartICles usIng a texture | 715 To randomize the generation of the nParticles, you can use a texture. To help visualize how the texture creates the particles, you can apply the texture to the surface emitter: 1. Select the capsuleEmitter, and open the UV Texture Editor (Window  UV Texture Editor). The base already has UVs projected on the surface. 2. Select the capsuleEmitter, right-click the surface in the viewport, and use the pop-up menu to create a new Lambert texture for the capsuleEmitter surface. Name the shader flameGenShader. 3. Open the Attribute Editor for flameGenShader, and click the checkered box to the right of the Color channel to create a new render node for color. 4. In the Create Render Node window, click Ramp to create a ramp texture. 5. In the Attribute Editor for the ramp (it should open automatically when you create the ramp), name the ramp flameRamp. Make sure texture view is on in the viewport so you can see the ramp on the capsuleEmitter surface (hot key = 6). 6. Set the ramp’s Type to Circular Ramp, and set Interpolation to None. 7. Remove the blue color from the top of the ramp by clicking the blue box at the right side at the top of the ramp. Click the color swatch, and use the Color Chooser to change the green color to white and then the red color to black. 8. Set Noise to 0.5 and Noise Freq to 0.3 to add some variation to the pattern (see Figure 13.36). 9. In the Outliner, select the nParticle node and hide it (hot key = Ctrl+h) so you can ani- mate the ramp without having the nParticle simulation slow down the playback. Set the renderer to High Quality display. Figure 13.36 Apply the ramp to the shader on the base capsuleEmitter object. [...]... Autodesk- approved graphics card, you should be in good shape The Hardware Render Buffer vs Maya Hardware There are two ways to hardware render in Maya: you can use the Hardware Render Buffer, which takes a screenshot of each rendered frame directly from the interface, or you can batch render with Maya Hardware Maya Hardware is chosen in the Render Settings window The Hardware Render Buffer uses its... render the nParticles This can be done using mental ray, Maya Software, Maya Hardware, or the Hardware Render Buffer This section demonstrates how to render using the Hardware Render Buffer Later in the chapter you’ll learn how to render nParticles using mental ray Shading nParticles to Simulate Flames Shading nParticles has been made much easier since Maya version 2009 Many of the color and opacity attributes... rendered using software (Maya Software or mental ray) All nParticle types can be rendered in mental ray, although the results may be different than those rendered using the Hardware Render Buffer or Maya Hardware Network Rendering with Hardware If you are rendering using a farm, the render nodes on the farm may not have graphics cards, so using either the Hardware Render Buffer or Maya Hardware won’t actually... a more randomized radius for the nParticles | Chapter 13â•… 7 38 •… Introducing nParticles 12 The normals for the dome shape are actually pointing outward You can see this if you choose Display  Polygons  Face Normals To reverse the surface, switch to the Polygons menu set, and choose Normals  Reverse (see Figure€13. 58) Figure€13. 58 Reverse the normals for the dome surface so they point inward... set Opacity Scale Randomize to 0.5 8 Expand the Color rollout panel Set Color Input to Age Click the ramp just to the right of the color marker to add a new color to the ramp Click the color swatch, and change the color to yellow 9 Add a third color marker to the right end of the ramp, and set its color to orange 10 Set Input Max to 2 and Color Randomize to 0 .8 See Figure€13.44 11 In the Shading... fastest and easiest ways to render flames in Maya is to use the Hardware Render Buffer The results may need a little extra tweaking in a compositing program, but overall it does a very decent job of rendering convincing flames The performance of the Hardware Render Buffer depends on the type of graphics card installed in your machine If you’re using an Autodesk- approved graphics card, you should be... suit your needs Maya makes this process fairly easy, because there are several rendering styles to choose from, including Point, MultiPoint, Blobby Surface, Streak, MultiStreak, and Cloud Any one of these styles will change the appearance of the individual nParticles and thus influence the way the nParticle effect looks in the final rendered image To make coloring the nParticles easy, Maya provides you... and add some keyframes to the curve 17 Use the Move tool to reposition the keys to create an erratic motion to the ramp’s animation (see Figure€13. 38) Figure€13.37 Position the white color marker at the bottom of the ramp and keyframe it Figure€13. 38 Add keyframes to the ramp’s animation on the Graph Editor to make a more erratic motion | Emit nParticles Using a Texture â•… 717 Animate U Wave and... End Frame to 200 Keep By Frame set to 1 Keep Image Format set to Maya IFF This file format is compatible with compositing programs such as Adobe After Effects 5 To change the resolution, you can manually replace the numbers in the Resolution field or click the Select button to choose a preset Click this button, and choose the 640 × 480 preset 6 In the viewport window, you may want to turn off the... Hardware Render Buffer 9 Play the animation to about frame 45 10 In the Hardware Render Buffer, click the clapboard icon to see a preview of how the render will look (see Figure€13. 48) | nParticles and Fields â•… 727 Figure€13. 48 When Geometry Mask is enabled, the Hardware Render Buffer renders only the nParticles 11 If you’re happy with the look, choose Render  Render Sequence to render the 200-frame . machine. If you’re using an Autodesk- approved graphics card, you should be in good shape. The Hardware Render Buffer vs. Maya Hardware There are two ways to hardware render in Maya: you can use the. 13.29). Figure 13. 28 Align the pivot point for the tub group with the handles from the side view. Figure 13.29 When you animate the tub, the nParticles pour out of it like water. 7 08 | CHAPTER. set to 5. Surface Tension The Liquid Simulation settings now have a Surface Tension slider in Maya 2011. Surface tension simulates the attractive force within fluids that tends to hold them together.

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

TỪ KHÓA LIÊN QUAN