Bookshelf Contents Previous Next Glossary Index Search

Lesson 25: Particles

Particles are small pieces of geometry that help you create natural phenomena such as gases or liquids that are difficult to simulate using surface geometry. Particles can be emitted either through lights or through shaders. Particles are integrated with motion dynamics features such as wind, gravity and collision, giving particles the ability to create very realistic effects.

This lesson takes the form of a science experiment to help you explore particle systems. First, you will create a particle simulation that begins with smoke billowing from a flask. The smoke is emitted from a light source. As the experiment gets more active, you introduce an eruption of chemical goo that is emitted from a shader. This lesson shows you how to set up the particle system, how to adjust some of the parameters to change the attributes of the particles, how to integrate particles with other motion dynamics, and finally how to integrate the particles for a rendered animation.

Initial Setup

You start this lesson by opening an existing file. The file contains all the required geometry and shaders. The scene itself consists of the glass flask, the interior liquid, an area light and a semi-spherical object at the mouth of the flask. In this lesson, you emit particles from the area light and partial sphere.

Clear the workspace and retrieve the wire file

  1. From the File menu, select Open.
  2. In the CourseWare project, choose the wire file L25_Science to retrieve it. A full-screen Perspective window appears with the pre-built geometry.

Smoke: Creating Particles from a Light

The smoke particles will be emitted from the area light called smoke, at the mouth of the flask. In the light attributes, you first turn on the particle emission, then control the generation of the emission.

Open the Light lister and choose the "smoke" light

  1. From the Windows menu, select Multi-lister Lights... to list the lights only.
  2. Double-click the area light called smoke to open the Light editor.

    Turn on the Particle Emission.

  3. In the Light editor, open the Active Effects section and set Emit Particles to ON.

    You have now turned particle emission on for the area light. A new Particle Emission section appears as part of the Light Editor.

    Set the Particle Emission Motion Type

  4. In the Particle Emission section, make sure that the Presets is set to STEAM and the Motion Type is set to GAS.

    Note: The Particle Presets is a list of particle emission effects that are ready for you to use in your work. These presets set the necessary parameters in the Editor and even the Environment to set up a good starting point for your work.

    Even though you are trying to create smoke, you did not choose this option from the list since you need to learn how to set particle parameters on your own. After this lesson you may want to return to the presets list and experiment with the various options available to you.

    Set the rate, decay and life span of the particles

  5. Click the Generation section to open it.
  6. In the Generation section, set Particles/Sec to 100, to reduce the amount of particles and to obtain a scattering effect.
  7. In the same section, set the Speed to 1.3. This lets the smoke come out of the flask at a moderate speed.
  8. Set the Speed Decay to 0.985. The decay refers to the percentage decrease in speed over time. Setting the decay close to 1.0 ensures that most of the initial speed is preserved during the animation, allowing the particles to create a smoke trail.
  9. Next, set the LifeSpan min to 30, and LifeSpan max to 300. On average, you want the particles to exist between 30 and 300 frames. The lifespan controls how many particles are in the scene, as well as how long the particles move about before being dissipated.

  10. Close the Light Editor and minimize the Multi-lister.

Previewing the particle systems

After you have turned on the particle emission for a light, you can preview the simulation using a wire representation of the particles. You can then add the light to the simulation picklist and evaluate the particle simulation.

Open the Run Dynamics window

  1. From the Animation menu, select Run dynamics-. This opens the Run Dynamics window.

    Tip: You should position the window towards the top right corner of the screen, so you don't obscure the mouth of the flask.

    Set the end frame of the simulation

  2. In the Run Dynamics window, go to the Frame Control section and set the End Frame to 200 to limit the simulation to two hundred frames.

    Include only the smoke area light in the simulation

  3. Scroll down to the Participating Objects section and set the Active Objects to NONE, Passive Objects to NONE, and Force Objects to NONE, to limit the amount of influence to the smoke during the simulation. This lets you evaluate the simulation as you go along, adding other participating objects to enhance it as you need to.
  4. Set Show Particles to PICKLIST. This setting uses whatever you have picked to emit particles if particle emission has been turned on.

    Pick the smoke area light

  5. Select Pick Object and type smoke on the prompt line to pick the area light. Picking the light adds it to the active pick list for emitting particles.

    Run the simulation

  6. Click the Run button on the bottom of the Run Dynamics window, to begin the simulation.

    Notice how the particles are being emitted from the area light, and are streaming upwards. The simulation stops automatically at frame 200.

  7. To rerun the simulation, click the Reset button to bring the simulation back to the start frame (frame 1), then click the Run button again.

Editing the Particle Attribute Parameters

The particles have surface attributes that dictate their look, feel and movement. The particles' attributes are set to look like white smoke.

Open the Light editor for smoke

  1. Click the Multi-lister icon to maximize the Light lister. Double-click the smoke area light to open the Light Editor.

    Set attributes to create white smoke

  2. In the Particle Emissions section, click Render Parameters to show the rendering attributes for the particles.
  3. The Render Type defaults to THIN GAS and the Color is white. You can leave these parameters at their defaults.
  4. Click the Incandescence color swatch and set the RGB values to 150 150 172.
  5. Click the Transparency color swatch and set the RGB values to 220 220 220. You should also set the Density to 0.35.

    These settings make the smoke transparent and airy, with a slight glow.

  6. Close the Light editor and Color editor, then minimize the Multi-lister.

Previewing the Simulation

To visualize the particles, you can choose from several different display types.

Preview the simulation using Color outlines

  1. From the DisplayTgls menu, select Render Toggles Particles-.
  2. Set the Display Method to Color Outline and click Go.
  3. Click the Reset, then the Run button in the Run Dynamics window to preview the particles.

    The simulation is now displayed in more detail than before.

    Preview the simulation using full shading

  4. From the DisplayTgls menu, select Render Toggles Particles -. Set the Display Method to Full Shaded and click Go.
  5. Click the Reset, then the Run button in the Run Dynamics window to preview the particles.

    You can barely see the simulation because the light grey background is too close in color to the particles.

  6. From the Preferences menu, select Interface User colors.... In this window, open the Modelling Window Colors section and click the color swatch next to the word Background.
  7. In the Color editor, enter RGB values of 50, 50, 50. This will set the background to a dark gray.
  8. Click the Reset, then the Run button in the Run Dynamics window to preview the particles.

You can now see the particle simulation in the modeling view window as a rendered effect.

QuickRender a frame

Another method to test the look of a simulation is to QuickRender a single frame to see how the simulation is rendering.

  1. In the Palette, select Anim View frame, and type 100, to see frame 100. The simulation is updated to frame 100.
  2. From the Render menu, select Quick render -. Turn Background on and set the Shading Frequency to 8. Click Go to get the first evaluation of the particles. After rendering the geometry, QuickRender calculates and renders the particles.

    Tip: You may also do a test render at this point, to get a better evaluation of the particles and to render the glass transparent.

  3. Click to close the QuickRender window.

Creating an Object Set

The simulation you have been running is based on a temporary picklist. To make your choice permanent for the purpose of storing or rendering the simulation, you must create a particle set. A particle set contains the objects participating in the simulation - in this case, the area light emitting the smoke particle.

Add the smoke light to the participating objects list

  1. With the smoke area light still picked, go to the Run Dynamics window and scroll down to the Participating Objects section.
  2. Next to Show Particles, click the Edit menu and choose Add pick to set. A dialog box appears and prompts you for the name of the set.
  3. Type smoke in the name field to create the smoke set containing the smoke area light.

    Pick the <smoke> set as the set to participate

  4. Check that Show Particles is set to <smoke>. The object in the smoke set should now show the particles during a simulation.

    Run the simulation again

  5. Select Pick Nothing to unpick the area light.
  6. Click the Reset button at the bottom of the Run Dynamics window to reset the simulation to frame 1.
  7. Click the Run button to rerun the simulation. The smoke area light is picked and included in the simulation because it is part of the simulation set.

Adding Environment Turbulence

The particles emitting from the smoke area light are streaming upwards in a rather structured and dull looking manner. In the environment shader, you can set environmental effects such as turbulence to give the particles a swirling effect.

Open the Environmental editor

  1. In the Run Dynamics window, click the Edit Environ button to open the Environment editor window.

    Set the turbulence parameters to swirl the smoke

  2. In the Environment editor, click Dynamics Globals to open this section, then click Turbulence (noise) to show the environmental turbulence parameters.
  3. Set the Intensity to 0.5, the Spread to 0.75 and the Persistence to 2.0. Set the Animated parameter to OFF. This sets the amount, force and fluctuations of the turbulence.

  4. Close the Environment editor window.

    Run the simulation

  5. In the Run Dynamics window, choose Reset to return to frame 1 of the simulation.
  6. Click Run to begin the simulation. At the initial introduction of turbulence, an internal force table is generated which is used in the simulation. The table may take a few seconds to create.

    Adjust the Turbulence settings

  7. To learn more about the capabilities of Turbulence, experiment with the settings and run the simulation again.

    Tip: You can adjust the turbulence parameters while the simulation is running if you need instant feedback.

  8. When you are finished, set the parameters back to the settings shown in step 3.
  9. Close the Environment editor.

Adding a Wind Force

The particle system is integrated with the basic dynamic capabilities, and can therefore be influenced by forces. In this section you add a wind force created with a volume light to blow the smoke during the simulation. The volume light wind force is set up as an "upper draft" to alter the direction of the smoke plume as it rises in the air.

Place and scale a volume light

  1. Select Objects Lights Volume.
  2. At the prompt, type -4, 0, 3.5 to place the volume light above and to the left of the flask.
  3. Select Xform Nonp scale, and type 10 6 1 at the prompt. The volume light is now a stretched sphere sitting above the flask.

    Open the light editor of the volume light

  4. Maximize the Multi-lister. Double-click the name of the new light and change it to Draft.
  5. Next, Double-click the new volume light icon to open the Light editor.

    Set the light to a wind force with some turbulence

  6. In the Active Effects section, change the Force to WIND. The volume light now exerts a wind force. Click the Common Parameters section to open it, and set the Force Intens. slider to 7.5. This is the strength of the wind force inside the volume light.

    Note: The light has two different intensity parameters, one for the light itself and one for the force that it emits. Make sure that you set the Force Intensity.

  7. Click the Volume Parameters section and set the Shape to BOX. This gives the draft a layered effect.
  8. Scroll down and open the Turbulence section. Set the Intensity to 0.15, the Spread to 0.375, and the Persistence to 0.25. This gives the wind force a little action as it affects the particles.

  9. Close the Light editor and minimize the Multi-lister.

Re-run the simulation

This new light affects how the smoke particles react as they rise from the flask when you again run the simulation. To begin, you must add the volume light to the simulation as a Force object.

Adding the volume light draft to simulation

  1. In the Run Dynamics window, open the Participating Objects section.
  2. Set Force Objects to PICKLIST. This setting uses whatever you have picked to act as a force in the simulation.
  3. Check that Show Particles is still set to <smoke>, so that the smoke particles are part of the simulation.
  4. If the Volume light is not already picked, select Pick Nothing, then Pick Object. Carefully pick only the draft volume light to add it to the active pick list for Force Objects.

    Run the simulation

  5. Click Reset, then Run on the bottom bar of the Run Dynamics window, to begin the simulation.
  6. Notice that as the particles stream up and enter the draft, they begin to drift along with the wind force. After the scene is rendered, the effect will be like a plume of smoke.

    Create an object set for the force

  7. In the Participating Objects section, go to the Edit menu next to Force Objects and select Add pick to set.
  8. Type Draft in the set dialog box. Click OK. The Force Objects is now set to <Draft>.
  9. Click Reset, then Run to run the simulation.

    Now the two lights are included in object sets. At this point, even if you were to unpick all the objects and lights and then run the simulation, the smoke and wind force would still participate.

Chemical Goo: Creating Shader Particles

Having created smoke emanating from the flask, you can now create the simulation of chemical goo oozing violently from the flask. The chemical goo itself is just particles emitted from a shader. First, you turn on the particle emission for a shader that is assigned to the semi-spherical object goo. Like lights, shader emitting particles must be added to the simulation as participating objects and must have all the proper parameters set.

Open the Shader Editor for the shader Goo

  1. Maximize the Multi-lister. From the Multi-lister's List menu, select Shaders. This shows only shaders in the lister.
  2. Double-click the Goo shader to open the Shader editor.

    Turn on the shader particle emissions

  3. In the Shader editor, choose Special Effects to show the shader effects parameters.
  4. Set Emit Particles to ON, to turn on the particle emissions for the shader. Note that the Particle Emission menu choice appears at the bottom of the shader attributes.
  5. Click the Special Effects section to close it.

    Set the type, rate, and life span of the particles

  6. Scroll down to the Particle Emission section to show the shader's particle parameters.
  7. Set Motion Type to SOLID. Unlike the smoke, this goo should have solid properties.
  8. Scroll down to the Generation section and set the Particles/Sec to 500.0. For the chemical goo, you need lots of particles.
  9. Set the Speed to 4.000. This is a moderately fast initial velocity, which you need if you want the particles to boil out of the flask.
  10. Set the LifeSpan min to 30 and LifeSpan max to 200. This gives the chemical goo particles a lifespan between 30 and 200 frames before they dissipate.

  11. Close the Shader editor and minimize the Shader lister.

Create a simulation for the Goo

To explore the chemical goo particles, you need to set up a simulation for these particles on their own. You can later combine the goo and the smoke into a single simulation.

Include ONLY the shader particle emission

  1. With Nothing picked, select Pick Object and type goo to pick this object. It is a small partial sphere at the mouth of the flask.
  2. If the Run Dynamics window is not already open, from the Animation menu select Run dynamics-. In the Run Dynamics window scroll down to the Participating Objects section.
  3. Set the Active Objects to None, the Passive Objects to None, and the Force Objects to None.
  4. Now, click next to Show Particles and choose PICKLIST.
  5. Click the Edit menu and select Add pick to set. Name the new set GOO and click OK. Make sure that the new <GOO> set is chosen.

    This temporarily leaves the smoke particles out of the simulation so you can evaluate the chemical goo.

    Preview the simulation

  6. Click Reset, then Run to see the simulation.

    As the particles are emitted from the surface, they stream downwards. The direction of the shader particle emission is dependent on the normals of the surface. You need to adjust the surface normals to reverse the direction of the emissions.

Adjusting the object's normals

Shader particles are emitted in the direction of the surface normals. If the normals are pointing in the opposing direction, as in this case, you must flip the normals by changing the direction of the U and V of the surface.

Reverse the normal direction of the goo object

  1. Select Object Edit Reverse direction-. Set Surface reversal mode to Swap U and V directions and click Go. When prompted, click the goo object with the left mouse button to display the direction of the normals. Click the middle mouse button to swap the U and V directions hence reversing the normals which should now be pointing upward.

    Preview the simulation

  2. Click Reset, then Run to see the simulation. Now the particles stream up from the surface. Gravity then takes hold and they begin falling down to the surface of the flask.

    Note: Gravity is found in the Environment Editor. By default it is set to 1.0 and affects liquid particles.

Particle Collisions

If you let the simulation continue, the particles fall to the ground and pass through the surface of the flask. By introducing collisions, the particles can collide with the flask's surface and flow down its sides. To achieve this affect, you apply collision detection to the shader particles and add the flask to the simulation as a passive colliding object.

Turn particle collision on for the Goo shader

  1. Maximize the Multi-lister. Double-click the Goo shader to open the Shader editor. Minimize the Multi-lister.
  2. In the Shader editor, go to the Particle Emission section and then the Behavior section. Set Collisions to ON. This turns on the collision capabilities for the particles. Leave the Hit method set to BOUNCE. Close the Shader Editor.

    Turn particle collision detection on for the flask

  3. Select Pick Nothing, then Pick Object and type flask to pick it.
  4. In the Run Dynamics window, open the Collision Types section.
  5. Next to flask, set Particle Collision to GEOMETRY, so that the flask can now be detected according to its geometry.

    Add the flask to the list of participating objects

  6. Scroll up to the Participating Objects section and select the Edit menu next to Passive Objects and choose Add pick to set.
  7. Type FLASK in the set dialog box. Make sure that the Passive Objects are set to <FLASK>. The flask is added to the simulation as a passive object with collision detection.

    Preview the simulation

  8. Click Reset, then Run to see the simulation. The particles now rise, with some falling back and colliding with the flask, then sliding along its sides.

Editing the Particle Attribute Parameters

Like particles emitted from lights, the particles emitted from shaders have surface attributes that dictate their look, feel, and movement. To experiment with this, you can turn the particles into a blob of red and black chemical goo.

Open the Goo shader editor

  1. Maximize the Shader lister. Double-click the Goo shader to open the Shader Editor.

    Set the type of particles emitted from the shader

  2. Open the Particle Emission section then click Render Parameters to open this section. Set the Render Type to BLOBBY SURFACE, and set the Blob Lighting to SELF_SHADOWING.
  3. Click the Color swatch and enter RGB values of 200 0 0.

    Use a Marble as an incandescence map

  4. Click the Map button beside the Incandescence parameter to open the color mapping window.
  5. Scroll down to the Solid section and open it. Click sMarble to use this mapping type as the incandescence map.
  6. In the sMarble editor, choose sMarble Texture Parameters and set the Filler_color to RGB values of 74 0 0, and the Vein_color to RGB values of 0 0 0.
  7. Next, set the Vein_width to 0.35, the Diffusion to 0.3 and the Contrast to 0.2. This develops the colors for the incandescence map.

  8. Select Pick Nothing then click the Solid Texture placement box in the bottom right of the sMarble texture in the Multi-lister. (See the following illustration.)

  9. Select Pick Object and click the texture placement box in the Perspective window.

  10. Select Xform Scale and scale the box to 0.3.
  11. Click the box icon in the Multi-lister to hide the texture placement object.

    Set the parameters of the particles

  12. In the Render Parameters section of the Goo shader, click the Transparency swatch and set the RGB values to 0 0 0.
  13. Next, set the Density to 0.64, the Translucence to 0.1, the Surf Shading to 0.14, the Blob Threshold to 0.85, and the Blob Noise to 0.78. These settings were generated based on a lot of experimenting.

    After you preview the goo, you may want to reset some of these parameters to see how they affect the look of the particles.

    Tip: It is always important to experiment with the settings to obtain the desired look and feel for solid particles.

  14. Minimize both the Shader lister and Shader editor.

Running both simulations

You have a simulation for smoke and a simulation for chemical goo. To run both together, you just add all the components to the simulation. Once they are running, you can render the results.

Include both the wind force and collision objects

  1. In the Run Dynamics window, set the Active Objects to NONE, the Passive Objects to <FLASK>, and the Force Objects to <Draft>. The flask and the draft volume light are included in the simulation.

    Include both the particle emitting light and surface

  2. Set Show Particles to ALL. Since there are only two objects emitting particles, both are included in the simulation.

    Preview the simulation

  3. Click Reset and then Run to see the simulation. Notice that both simulations are occurring at the same time.
  4. Click to stop the simulation.

    Delay the chemical goo particles by 50 frames

  5. Maximize the Shader editor, and in the Particle Emission options, set Start Frame to 50. The shader should now start emitting particles at frame 50. Minimize this window.

    Again Preview the simulation

  6. Go to the Run Dynamics window and click Reset and then Run to see the simulation. Although the smoke appears immediately, the chemical goo doesn't start until frame 50.

Rendering a still frame

Before you render the complete animation, you should always render a single test frame to see the final effect of the shader attributes. Rendering it in low resolution yields faster results.

Open the Globals Window

  1. From the Render menu, select Globals... to open the Render Globals window.
  2. In the Render Globals, set the Animation to OFF, so that the animation sequence is not rendered.

    Set the resolution of the animation render

  3. Click the Image File Output section to open it. Make sure that the X and Y resolutions are set to 645 x 486 (NTSC). Close this window.

    Choose a frame to Render

  4. If the Time slider is not visible, select Animation Tgl time slider.... Set the current frame to 120 to move to this frame where both the smoke and goo are present.

    Raycast the frame

  5. From the Render menu, select Render -. Set the Renderer Type to Raycaster and turn on the Test Render option. Set the Test resolution to 0.5 and click Go. The raycast automatically starts. It may take several minutes.
  6. If the Render status bar is not visible, select Render Toggles Render status from the DisplayTgls menu so that you can monitor the progress of the animation. From the Render menu, select Show render to watch the current frame being rendered.

Rendering an Animation

You can now render the final animation. Set the Render Globals to accept an animation and then Raycast an animation of part of the simulation.

Set the animation parameters

  1. Close any windows you have used so far.
  2. In the Time slider, click the Min/Max button and select Start/End. Enter 1 for the Start frame and 150 for the End frame. In the top right corner of the Time Slider, set by to 2. This means that every other frame between 1 and 150 is rendered. (This keeps the rendering smaller.)
  3. From the Render menu, select Globals... to open the Render Globals window. Here you set the quality and resolution of the animation.
  4. In the Render Globals window, set the Animation to ON, so that the animation sequence is rendered. Close this window.

    Raycast the animation

  5. From the Render menu, select Render -. Turn the Test Render option off and click Go.
  6. Enter the name science_anim and click the Save SDL button. Once you have saved the SDL file, the raycast automatically starts. This may take several minutes for each frame.
  7. You can monitor the progress of the animation in the Render status bar. From the Render menu, select Show render to watch the current frame being rendered.

    Playback the animation

  8. From the Animation menu, select Flipbook. Alias prompts you for a filename.
  9. Choose the first frame titled science_anim.1 and the sequence automatically loads into the flipbook. Once all the frames have been loaded, flipbook plays them back at 30 frames per second.

Resetting your user colors

Earlier you set the background color to a darker color in order to better visualize the particles. If you want to reset your user color back to the default grey, then enter the values shown below.

  1. From the Preferences menu, select Interface User Colors.... In the Modeling Window Colors section, click the color swatch next to the word Background.
  2. In the Color editor, enter RGB values of 161, 161, 161. This resets the background to its default gray.

Conclusion

You now have a basic understanding of particles and how to integrate them into the Alias environment. In this lesson you have learned how to:



Bookshelf Contents Previous Next Glossary Index Search

[email protected]
Copyright © 1998, Alias|Wavefront, a division of Silicon Graphics Limited. All rights reserved.