Project 4a: Particle Effects

Goal We are going to learn how to add a bit of polish with dynamic effects using particles and fluids. The end result will be a fully composited and rendered animation of a burning log complete with roaring flames and sparking embers.

This project will be broken into two phases:


Phase I: Particles

Particles represent tiny objects such as snow, dust, or sparks. Since there can be sometimes hundreds or thousands of these particles, it is infeasible to animate them by hand. Instead you create a procedural animation for them by setting up some basic rules and behaviors and the particles animate themselves according to these constraints. This phase will walk you through setting up a simple particle system that simulates sparks.

  1. The first step in setting up a particle system is to create a particle emitter. Switch to the Dynamics menu set and go to Particles → Create Emitter (Options). We will need to adjust several of the emitter's attributes. This can be done before creation or afterward through the Attribute Editor.

    Call the new emitter sparksEmitter. Since we want our sparks to come from a log, set the Emitter type to Volume and the Volume shape to Cylinder. Rotate and scale the new volume emitter until it resembles a log. If you hit Play, you should see particles being emitted in all directions.

    Increase the frames in your Time Slider to 300. Going back to frame 0 will reset the particle simulation back to its initial state.

    By default Maya will try to play your effect in real-time. If it can not keep up with the computation required to simulate your effect, then it will cut some corners to make up time. This generally not what you want and can be especially problematic with fluids. To make sure Maya calculates every frame go to Window → Settings/Preferences → Preferences → Time Slider and set Playback speed to Play every frame.

  2. In the Attribute Editor of the emitter, under Basic Emitter Attributes, change the Rate to 25. Under Basic Emission Speed Attributes, change Speed Random to 3. In the attributes of the particleShape, under Lifespan Attributes, change Lifespan Mode to Random range, Lifespan to 1.5, and Lifespan Random to 0.5. This means that every particle will last for anywhere from 1 to 2 sec.

  3. At the moment, the particles are emitted in all directions and travel in a straight line. We can affect the trajectory of a particle after it has been emitted by creating fields that are linked to the particles. Fields act as forces that affect the particles in a certain way, such as being pulled down by gravity.

    Fields can be linked to particles when they are created by selecting the particles before creating the field. With the particles selected, create an Air and a Turbulence field from the Fields menu and make sure they are linked to the particles. The default settings for the Air field should be sufficient, but change the Magnitude of the Turbulence field to 25.

  4. You may have noticed that the particles currently don't render. The first step to fixing that is to go to the attributes of the particleShape. Under Render Attributes, change Particle Render Type to Tube and click the Current Render Type button. Set Radius 0 and 1 to 0.03 and Tail Size to 2. This should make the particles look like below.

  5. The particles still have the default particleCloud shader assigned to them. Assign a new Particle Cloud shader to the particles. This can be found under the Volumetric in the Hypershade. The Particle Cloud shader has Life Color, Life Transparency, and Life Incandescence attributes. These affect the appearance of the particles based on how old they are.

    Map Ramp A into the Life Color and Life Incandescence of the particleCloud. Map Ramp B into the Life Transparency. Change the Glow Intensity to 0.3. This will simulate the spark cooling as it travels through the air, eventually turning to ash and disappearing.

    Ramp A:

    Ramp B:

  6. If you render your particles, they should look like those in the image below.

    As a finishing step, you will need to do a little Outliner cleanup. Group your fields and name the group "fields". Group your particles and name the group "particles". Group those groups together and name it "sparkFX".

    Save your file as yourname_effects_phase1.ma.

    Now is a good time to take a break, grab some coffee, stretch your legs, save again, scream in a pillow, etc. When you come back we're moving on to Phase II.


Phase II: Fluids

When you think of the word fluids, you probably imagine an effect that creates the splashing of water. In Maya Fluids refers to fluid dynamics, which deals with the interaction of fluids of similar density such as fire and air, smoke and air, or ink and water. Fluids can create very convincing effects, but as always, there is a performance tradeoff. Fluids are expensive to set up and expensive to render. In this phase we will walk you through creating a simple fire.

A large battle during a production, especially with effects, is finding ways to reduce your build time. We are going to use a little shortcut that will allow us to create a fire effect that would likely take several hours to build from scratch.

  1. In the same file from Phase I, using the Dynamics menu set, go to Fluid Effects → Get Fluid Example.... This will load the Maya Visor where we can select from a range of premade effects. These examples work well as a starting point to achieve some fairly complex effects. Choose Fire, select the TurbulentFlame.ma icon, Middle mouse click and drag the icon to your viewport.

  2. Unlike particles, fluids are contained in boxes (containers) which they cannot escape. The insides of these containers are divided into a set of "voxels" - points in space at which the various properties of the fluid are calculated. Increasing the resolution results in a higher fidelity image, but also takes longer to calculate and consumes more memory.

    Step 1 will create a fluid container (Flame) with a fluidEmitter attached to a nurbs torus. Don't worry about all this junk, we only want the emitter settings and the fluid container. This is where some trickery comes into the mix. We want to 'steal' the emitter settings from fluidEmitter and apply them to a new one we are about to create. In your Outliner, underneath the nurbsTorus, select the fluidEmitter and open the attribute editor. Select Presets → Save fluidEmitter preset.... Name it something like flame_preset.

  3. Now that we have our preset made, we can delete everything EXCEPT the fluid container (Flame) and your SparkFX group. Move and scale the fluid container so it snugly fits the sparksEmitter like the image below.

  4. Create a polygon cylinder and name it log. Rotate, move, and scale your log so it fits inside your sparksEmitter Shape like the image below.

  5. Now we are going to create our own fire emitter. First select your log, THEN shift+select the fluid container. In the Dynamics menu set, go to Fluid Effects → Add/Edit Contents → Emit from object (options). Name the emitter logFlame_emitter and make sure the emitter type is set to surface. Click Apply and close. Select the emitter, and then in the attribute editor apply your created preset.

  6. At this point go ahead and hit 6, rewind and play the timeline. You should see Maya's attempt to preview what your fire is looking like. Find a spot that you like and take a quick render to see how we are doing. If all goes well you should have something that looks like the image below. Save your maya file as yourname_effects_phase2.ma. Take a screen snapshot, similar to below, and save it as yourname_effects_phase2.jpg.

Turn In You will be graded on the following: Turn in the following: