Particles

table of contents

Maya's Particle Systems feature allows you to create complex collections of objects that look and behave similarly. Particles are ideal for animating difficult effects, such as aerosol sprays, explosions, swarms of bees, and galaxies of stars. You certainly wouldn't want to have to model and animate each member of one of those effects! With Particle Systems, it's easy to create these effects with as many particles as you want. The particles can also collide with objects and be influenced by the same fields discussed earlier in the "Rigid-Body Dynamics" section.

Creating Particles

To create particles in your scene, you can use drawn particles or particle emitters . Generally, you use drawn particles when you want them to start out in a prearranged pattern and exist throughout the animationfor example, to create a galaxy or star field. To paint particles in your scene, choose Particles Particle Tool, which enables you to spray-paint particles where you want them. Another method called Particle Grid is available, which you use to define the corners of a 2D rectangle that will be filled with particles. Particle grids can be helpful for visualizing the effect of fields as you create them.

The more traditional approach to particle systems is using an emitter as the source that particles emanate from; eventually, the particles die. In Maya, the source can be many things:

  • Point omni An emitter that sprays particles from a point in all directions.

  • Point directional An emitter that sprays particles in a given direction from a point.

  • Volume Particles are created from some point within a defined volume, which can be a cube, sphere, cylinder, cone, or torus .

  • Surface You can define one of your scene NURBS or polygon objects to create particles from its surface.

  • Curve Any NURBS curve can emit particles.

Particle Types

In Maya, there are two types of particles: hardware-rendered and software-rendered. Most are hardware-rendered. These particle types require that you render by using the hardware rendering system (Window Rendering Editors Hardware Render Buffer), and the particles do not appear in any normal software render. The idea is that these particles hardware-render much faster than if they were part of the software rendering process and that anyone who owns Maya will own a compositor as well. You might think this makes using particles more difficult because when they disappear behind geometry, it could require applying complex alpha matting materials to those objects. However, the Hardware Render Buffer has an option for masking any particles that fall behind scene objects. Another issue is that most hardware rendering looks jagged (aliased). Antialiasing is similarly handled by multisampling in the Hardware Render Buffer, enabled by choosing Render Attributes on the Hardware Render Buffer menu (see Figure 14.6). So all you need to do is overlay the rendered particles' image sequence on the scene's software-rendered image sequence to complete the effect. If you have a lot of particles or a long animation, this should save hours of rendering time because the compositor can overlay the two sequences and display the result in a few minutes.

Figure 14.6. Adjusting the mass of one of the spheres.

graphics/14fig06.gif

Hardware-Rendered Particles

The following list describes the hardware-rendered particle types. Note that hardware-rendered particles cannot cast shadows or appear in reflections or refractions.

  • Point The default particle type, designed to render as a spot (it always faces the camera, so it has no apparent thickness ). It looks like a square of pixels unless you enable a rendering option called multipass rendering, which blurs smaller particles (size lower than 5) into circular dots. When hardware rendering, the render settings are in the Hardware Render Buffer dialog box, under Render Attributes.

  • Multipoint Like the Point particle type, but creates clusters of points to get a denser, clumpier appearance.

  • Streak Similar to the Point, but creates a streaking line instead of a dot. This type does not render until the particles are moving and you attempt to hardware-render a frame with particle motion. The size (line width) of these particles is fixed in pixels, so near particles seem to have the same width as far particles.

  • Multistreak Like the Streak particle type, but creates clusters of streaks to get a denser, grouped look.

  • Sprites Similar to Point in that Sprites always face the camera, but Sprites can have a texture and optionally an alpha (transparency) channel. In addition, these textures can be image sequences rather than still images. To create the effect of hundreds of flaming chunks of debris falling, you could use a single animated flame texture on a Sprite particle system.

  • Spheres These are three-dimensional spheres, and you can set the radius globally. You can apply simple flat color materials to the spheres, which are Gouraud shaded in the Hardware Render Buffer.

  • Numeric A test mode, this particle type displays an ID number for each particle. It's particularly useful for killing a stray particle that's going somewhere you don't want it to.

Software-Rendered Particles

The following particle types render as part of your scene when you render a frame. As such, they can also reflect, refract, and cast shadows; these options are available in the Attribute Editor for particles. There are four software-rendered particle types:

  • Blobby Surface A particle form of metaballs, the blobby surfaces look like spheres until they approach another, at which point they blob together like drops of mercury (see Figure 14.7). You can set the surface tension and the radius for each particle sphere. You can also texture this particle type, but you'll need to do test renderings to adjust the U and V mapping in the Attribute Editor for materials so that you can scale your textures to the right size.

    Figure 14.7. Blobby objects in the viewport and rendered; notice the inherent mapping coordinates for the texturing on the blobby surface.

    graphics/14fig07.gif

  • Cloud Similar to the Blobby Surface type, but designed to blur and soften the edges of the Blobby Surface to get a cloud-like appearance. This particle type works specifically with the Particle Cloud material type and does not render with typical object "surface" materials.

  • Tube As the name implies, the source object type is a kind of uncapped cylinder. You can define the radius at the two ends. This type of particle is automatically assigned the Particle Cloud material type, and renders only with volumetric material types.

  • Instanced Geometry If you need to substitute any sort of object for particles, you use the Maya's Instancer, which enables you to use any kind of geometry or textures you like. For example, if you wanted to make a swarm of butterflies, you would create a single flapping butterfly type after making a particle system that animates the flight paths. Then you would open the Instancer with Particles Instancer option box, and configure it to substitute the prototype butterfly for the particles.

Particle Materials and Age

Particle system materials can be made to vary by using Gradient Ramps for texturing. Each particle has an inherent age (the time since it has been emitted ) that Maya can use to calculate what part of the Gradient Ramp to use. Using this technique, you can make particles change color over the course of their lifespan. A typical use of this technique is to change the particle color based on its age to get the effect of sparks , for instance. The spark particles might be white at first, then cycle through yellow, orange, and red, and then fade to black, which can add to the realism of your particle effect. You can apply gradient ramps to any particle material swatch to cause it to vary with the age of the particle, where particle birth is the bottom of the gradient and particle death is the top (see Figure 14.8).

Figure 14.8. A gradient applied to particle materials can control the particle over its lifespan; with this gradient, the particle would begin with black, and then brighten and dim twice.

graphics/14fig08.gif

Particle Influences

Your particle systems can interact with your scene elements in several dynamic ways. Like the rigid-body dynamics discussed earlier, you can apply any of the same fields to particle systems to influence how the particles move. You can also define surfaces that act as particle collision objects. A third option allows you to specify goals, a configuration of particle positions that the particle system attempts to move to.

Fields

Fields were described in the section on rigid-body dynamics earlier in this chapter, and many of the field types are clearly oriented to apply to particle systems. Don't forget that nearly all the fields can be set to occur within a volume shape or to fall off with distance so that they have only a localized effect.

Collisions

Any particle system can collide with any scene geometry, but you have to set each collision up separately. To do so, you select the particles, Shift-select the geometry it will collide with, and choose Particles Make Collide. The particles then collide if they hit the object. This works regardless of whether the particles or object or both are moving. For example, the particles could be stationary, and then smacked into motion by an object. You can also set particles to die (meaning the particle disappears), split (separates into several particles that each have the same particle age), or spawn (the particle dies, but new ones are created in its place) when collision occurs. These effects are typically used for splatter or breakup effects, in which particles seem to break into shrapnel when they collide with an object.

Goals

Particles can also be set to have goals, meaning that the particles try to move to a specific configuration, shape, or location. You can use this effect to make particles chase their goal object while staying in a specific relative position to the other particles. You can also create effects such as cloth in wind or seaweed in water by using particles to control geometry, described in the "Soft-Body Dynamics" section later in this chapter. When a target object is assigned to the particles as a goal, the CVs (for a NURBS target) or vertices (for a polygonal target) collect particles that are evenly distributed on the goal object.

Tutorial: Chimney Smoke

Now that you've learned some of the possibilities of particle systems, you'll try applying them to a scene you know well by now. You'll load the house scene file you added Paint Effects to in the previous chapter and add another hazy elementas though this scene weren't foggy and smoky enough! You'll make the top of the chimney on the house emit particles and configure them to move like smoke. Then you'll add a material to the particles that enables them to render like smoke.

  1. After loading the scene file, you should hide everything but the chimney so that you can focus on the particle system you'll be applying and get faster feedback from Maya when you play the animation. To do that, switch to Four View mode, and then hide all the objects but the chimney by first RMB-clicking on the V next to the ChimneyL layer and choosing Select Objects (so the chimney layer objects are selected); now you can hide all deselected objects with Display Hide Hide Unselected Objects (hotkey: Alt+h ). This will leave only the objects in the ChimneyL layer selected. Center and frame the chimney in all the views (hotkey: Shift+F ).

    graphics/ch14c_icon.gif graphics/ch14d_icon.gif
  2. The chimney is animated to move around, so you need to use a part of the chimney, the chimney_pipe, to emit particles. Click any panel to deselect the currently selected objects, and then click the chimney_pipe to select it. Select the camera view and change it to the Perspective view with Panels Perspective Persp. Set this view to Shaded mode (hotkey: 5 ).

  3. Make sure the chimney pipe is still selected, and choose Particles Emit from Object option box. In the Emitter Options (Emit from Object) dialog box (see Figure 14.9), set the Emitter Name to ChimneySmoker , and select Directional in the Emitter Type list box. Also, be sure to select None in the Cycle Emission list box because you don't want to loop the smoke animation later. Expand the Distance/Direction Attributes section, and set the Spread to 0.2 . Also, set DirectionX to and DirectionY to 1 , which means the smoke will travel upward. Click the Create button to create the smoke emitter and close the dialog box. Now play the animation, and zoom in the Perspective view to the top of the chimney. You should see the particles leaving the chimney_pipe, as shown in Figure 14.10.

    Figure 14.9. Setting options for the smoke emitter.

    graphics/14fig09.gif

    Figure 14.10. The initial state of the smoke particles.

    graphics/14fig10.gif

  4. Stop playback at frame 50, and click the emitted particles. A green box will appear around the particles in the Shaded view, and the Channel Box will show the name for the particles: particle1. Change it to ChimneySmoke , and open the Attribute Editor.

  5. First, switch to the ChimneySmoker tab in the Attribute Editor. In the Basic Emitter Attributes section, select Volume in the Emitter Type list box. Farther down the Attribute Editor, you'll find the Volume Emitter Attributes section. Select Sphere in the Volume Shape list box to make the particles emit from a ball inside the chimney pipe, and enter 0.5 in the Volume Offset Y (the middle one) text box to push the ball a little higher up the pipe. In the Volume Speed Attributes section, enter 60 in the Along Axis text box, 10 in the Random Direction text box, and 60 in the Directional Speed text box (see Figure 14.11). Now take a look at the changed particle emission; it looks less like hair strands. If you can't see it, rewind the playback, and play from frame 0. You can stop it after roughly 100 frames to get the idea.

    Figure 14.11. The initial particle settings for changing how the smoke moves.

    graphics/14fig11.gif

  6. In the Attribute Editor, select the ChimneySmokeShape tab. In the Lifespan Attributes section, change the Lifespan mode from Live Forever to Constant, which means each particle is present in the scene for a certain number of frames and then disappears. The smoke effect should dissipate at a certain distance from the chimney, so set the Lifespan to 6 to make the particles disappear after six seconds. Expand the Render Attributes section, and in the Particle Render Type list box, select Cloud(s/w) for a software-rendered puffy cloud material type. Click the Add Attributes for Current Render Type button to see the cloud parameters. Enter 15 in the Radius text box, .7 in the Surface Shading text box, and .9 in the Threshold text box. Surface Shading indicates how sharply the clouds are rendered, with higher values making more distinct clouds. The Threshold attribute controls blending between cloud "puffs," with higher values blending the particles more. Click the Play button, and you'll notice a completely different look to the particles, as shown in Figure 14.12.

    Figure 14.12. The smoke particle size and type are now set up, and the particles travel upward and spread out.

    graphics/14fig12.gif

  7. Next, you'll make a material for the smoke. Open the Hypershade (hotkey: Shift+T ). Make sure the create bar is on and that Create Materials is active; right-click the Create Bar to change it if necessary. Create a new volumetric Particle Cloud material by MMB-dragging the material from the Create Bar (in the Volumetric section) to the Work Area. Select the particles in the scene, and then RMB-click on the new material in Hypershade and choose Assign Material to Selection. The scene is currently very dark, so add a Point light to make sure you're correctly evaluating the smoke as you create it. In the Channel Box, set the light's Translate X, Y, and Z to 175 , 400 , and 100 . In the Render Globals window, set the resolution to 320x240 so that you'll get a fast render. Rewind the animation and play it through to frame 100 or higher to have some particles to render. Position the Perspective view to see the lit side of the smoke and render a frame (a normal render, not IPR, which won't work for particles). It should look like Figure 14.13.

    Figure 14.13. The initial render of the smoke particles, lit by the added Point light.

    graphics/14fig13.gif

  8. Leave the rendering open, and drag a box around the smoke area. With the smoke material selected in Hypershade, open the Attribute Editor. Name the material SmokeCloud . Set the color to dark brown and turn the transparency up to about 75%. Click the Render Region button in the Render View window to re-render the portion inside the box you drew. You might want to resize the region (in the red rectangle) smaller to speed up rendering. It should render the area in the rectangle very quickly, enabling you to get quick feedback as you adjust settings and click the Render Region button.

  9. Set the Density to 0.05 and the Blob Map color to dark gray (HSV: , , 0.3 ). Render the view and you should see a more smokelike appearance. To add more complexity to the smoke, expand the Built-in Noise section. Change the Noise to 1 , the Noise Freq to 0.5 , and the Noise Aspect to 0.5 . If you render after each change, you can see the effect of adding a subtle perturbation in the noise settings. Next, in the Surface Shading Properties section, set the Diffuse Coefficient to 2 to make the smoke look more three-dimensional. Your renderings should look similar to Figure 14.14.

    Figure 14.14. The final rendered smoke after adjusting the material settings.

    graphics/14fig14.gif

    In the next step, you'll use a Ramp map in the particle's Life Transparency attribute to make particles fade away as they age. That way, when the particles get to the end of their lifespan (6 seconds), they will completely fade out instead of just popping off the screen in one frame.

  10. Play the animation to at least frame 200 and zoom the Perspective view back far enough to see the top of the smoke plume, where the particles should be fading out. In the Attribute Editor, with the SmokeCloud material showing, click the checkered button next to Life Transparency and click the Ramp type in the Create Render Node dialog box. Next, click the Go to Output Connection button (the right arrow icon) in the Attribute Editor. Click it again, and you'll see the Ramp Attributes. Click the color circles at the left of the gradient sample to change the color: Make the top circle white and the middle and bottom circles light gray (HSV: , , .75 ). This makes the particles' transparency increase until they're completely transparent at the end of their lifespan. To extend the middle color a little higher up the gradient, select Exponential Up in the Interpolation list box. Imagine the Ramp as the transparency value from birth at the bottom to death at the top (see Figure 14.15).

    Figure 14.15. The Ramp overrides the transparency value and fades each particle based on its age, mapping the Ramp over each particle's lifespan from bottom to top.

    graphics/14fig15.gif

  11. Now you can delete the temporary Point light and unhide all the scene geometry to render a test of the smoke. Because you have already tested the motion of the particles when you played the animation in Step 5, you have a good idea of how the smoke will move. Rendering a single frame now will confirm what the smoke materials look like in the context of the rest of the scene. Switch the shaded Perspective view to the camera view with Panel Perspective Camera and set the Shading mode to Bounding Box. Click the Play button and let the animation play forward to frame 100. This ensures that the particles are emitted from the start, so that they're in the right place when you go to render the frame. You can render the camera view with the hotkey Alt+F9 when the camera view is the active one. See the results in Figure 14.16.

    Figure 14.16. A rendering of the scene with the completed particle smoke effect.

    graphics/14fig16.gif

You should see a realistic smoke effect appearing from the chimney. You can compare your scene to the file included on the CD-ROM. If you like the still frames, you can render the entire animation, as you did in Chapter 12, "Cameras and Rendering." The smoke effect does not increase rendering time very much.

graphics/ch14e_icon.gif


Maya 4. 5 Fundamentals
Maya 4.5 Fundamentals
ISBN: 0735713278
EAN: 2147483647
Year: 2005
Pages: 201

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net