Particles and Dynamics
Breath Vapor Simulation
More and more, cold weather scenes are being shot in mild climates, or in enclosed studios for budgetary, temporal and comfort reasons. Since the climate on these shoots is not cold, we lose the little natural nuances of reality. Therefore, it becomes incumbent on the special effects department to add these little nuances to add to the sceneís overall believability.
One major nuance to contend with in such a shoot is the visibility of breath vapor when an actor or animal exhales in the cold climate. To that end, it has become the job of the soda caffeine-addled animator to add digitally created breath vapor to these actors or animals to further the illusion need for the scene.
| I will leave out all the
drudgery of setting up your camera and importing your images, as they will
differ from task to task. This
particular scene requires me to have a 320x240 render region with a
perspective camera set to a 35mm TV Projection film gate.
Once I have the images loaded into my image plane as an animated sequence, I have to track the camera to the background. Itís an annoying task, but most definitely necessary to get a good shot going. Figure 1.
Once I have a quick shot of whiskey with a tequila chaser, Iím ready to begin. I start first by creating a directional particle emitter. I use a directional so I can funnel the particles in any particular direction. Omni emitters donít work so well here.Judging from the way the women are facing, I set up my emitterís direction axis to spew particles away from their faces. In this case it would be primarily in the positive Z with a little negative X to boot: Direction X = Ė0.3; Direction Y = 0; Direction Z = 1.
I turn the rate of the emitter to 0, for now, so I can track the emitter to the womanís mouth without having particles everywhere. And, to make life easier, I create a locator, which I scale up to make it big and noticeable on my screen, color it red, and center it directly on the emitter. I group the emitter under the locator by middle mouse button dragging it in the Outliner window to the Locator node, which I have named Anim_breath_pack1. The locator makes it easier to see the location of the emitter, to select it, and to track its position.
| Next, I track the Locator/emitter group to the
first woman, placing and keeping it just in front of her mouth like a
carrot in front of a horse. Figure 2.
Not to say this woman is a horse.
I mean, I donít even know her.
She seems nice and all. Actually
sheís kind of cute, I wonder if sheís seeing anyone.
But I digress.
Ok, once the breath_pack has been tracked, I am ready to animate the rate of the particle emitter to correspond to her exhales. What I will be looking for here is not just when she exhales, but also how. Is she talking? Is she letting out a big sigh? Has she suddenly been hit by a shopping cart? This will dictate how much breath is being exhaled, which will directly correspond to how high the rate needs to be turned up.
I typically will lead her exhale by a few frames to give the rate of particle emission a chance to ramp up. For example, she is slightly exhaling between frames 6 and 17. I will set a keyframe of 0 on the rate of the emitter at frame 3 and a key of 100 at frame 10 and again a key of 0 at frame 15. This, along with my particle render type and lifetime (which I will get to briefly), will work nicely to give a small exhale look.
Another quick slug of whiskey, and I will continue this process; to spot when she is breathing out or speaking and keyframe my emitterís rate accordingly, leading by a few frames and ending a few frames early. The bigger the exhale, the larger I set my rate.
Now, at this point, put your feet up and relax a moment. Rest your eyes, play some Tetris, get a new bottle of whiskey, whatever. This is a critical part of the Maya animation process, especially if youíre being paid hourly.
To get the directional emitter to emit to properly look like an exhale, I need to set a number of itís attributes, before I go on to the look of the particles. I already have its directions set, and an animated rate that corresponds to the subjectís exhales.I shall proceed by setting a spread of 0.45. This will give me a nice 45-degree cone of emission for the particles. Not too thin, like a jet steam, not too wide like an explosion.
|| Next is my speed. Now here I typically will be content with a non-animated
number. But if your subject
is going from a trivial exhale to a barbaric yell, then you may want to
animate the speed to correlate to the force with which the subject
is exhaling. In this
particular clip, the two women are strolling along the street casually
talking about something, perhaps their inconsiderate boyfriends who always
leave the toilet seat up in the bathroom.
So, itís not so important to me here to animate the speed.
I have set mine to a constant of 2.0.
Iíve also set the Speed Random to a value of 0.35
to slightly randomize the speeds of the individual particles.
This gives the exhale a more natural movement and look.
Break for whiskey? Sure, and while youíre at it, look up ďlatexĒ on Ebay. Hello!
Now itís time to deal with the look of the particles. This will depend on a number of factors, and youíll probably end up going back and forth between the attributes on the emitter and the attributes on the particle to fine-tune the shot.
The particle render type I prefer to use here is the Cloud (s/w). I like it for a few reasons. Namely, however, it is a software render particle type, and I prefer those to the hardware types overall. The other type of particle mostly used for this type of simulation is the sprite. While I widely use sprites in a number of particle applications, I prefer the cloud render type for this particular purpose. I think they look better easier and faster than sprites. Also, they have a good way of blending together via their threshold attribute and generally give a finer render than sprites.
True, they will render much slower than sprites, but I believe this is a limited enough application of the particles to warrant a slightly increased render time. Plus they remind me of cotton candy. Mmmmm, cotton candy.
First up, lifespan. This dictates how long the particle will ďliveĒ in the scene. Now with colder climates, you will see a more pronounced breath, but it will be short lived. In more moderate cold climates, youíll see the breath for longer, but not as distinct. In warm climates you wonít see it at all, silly.For the lifespan mode I have set it to lifespanPP only, to give me the ability to control the lifespan on a per particle level. Under the lifespanPP attribute, I set a creation expression to control how long the particles live. Figure 4.
As a recap, a creation expression is a short bit of code that will affect a particle as soon as it is born and a runtime expression, other type of particle expressions, will affect the particle on every frame of the animation. Since I do not want the lifespanPP to change over time, a creation expression here is called for. I will right click on the lifespanPP attribute and select Creation Expression.
This will pop up the Expression
editor. Figure 5.
My expression reads:
This expression will set the lifespan of each particle born to a random number between 0.9 and 1.6. By setting a randomness to the lifespan of each particle, we make the whole effect behave much more naturally.Next up is the particleís size, or radius. Again I prefer to have a per particle control over each particleís size, so I have add a radiusPP attribute. I click on the General box under the Add Dynamic Attributes heading in the Attribute Editor with the particle object selected, click on the Particle tab, and select radiusPP. Figure 6.
This will create an attribute for this particle object that will control the radius for each particle. On this attribute I will create both a creation and runtime expression.The creation expression will give a random radius within a range to each particle as it is born. The runtime expression will allow each particle to grow in size the older it gets. This will help the breath dissipate into the cold air.
Once again, I will right click on the radiusPP attribute and select Creation Expression to open up the Expression Editor. In the editor I will type in an expression to create a random radius for each particle within the range of .05 and .2. The creation expression reads:
Once I hit the Edit button, I can click on the Runtime radio button in the middle of the expression editor window (see figure 5) to switch to the runtime expressions so that I can make the particles grow as time passes.
For this, I will create an expression that reads the current radius of the particle, and will, as each frame goes by, increase itself by 0.01.
The runtime expression reads:
The reason I have a semicolon at the end of all my expressions, other than being just plain cool, is a matter of MEL syntax. MEL, as you may know, is Maya Embedded Language, the programming code, so to speak, on which Maya is built. All expressions in Maya use MEL commands and syntax. So, for each MEL command to be distinguished from the next, a semicolon is placed after the command. Even if you donít have a second expression in the Expression Editor, itís still a good idea to end your expression with a semicolon. And the really hot chicks (or guys) dig it.
Onto the next attribute for the particles, and that is the Opacity. I want these particles to fade in and fade out, so I must attach a ramp to the OpacityPP attribute that is a gradient from black to gray and back to black again.
I click the Opacity button under the Add Dynamic Attributes section and choose Add Per Particle. OpacityPP now shows up in my Attribute Editor. I right click on it and choose Create Ramp.I create my ramp as in Figure 7. This will make the particles invisible at birth, make them fade in, and then fade out before their death (which I hear is quite nasty and painful).
Now since these are software rendered particles, this OpacityPP ramp will not affect the final render. This is a quick thing I do so I can see the particles fade in and out in the preview playblasts and in the perspective windows when I scrub the animation as I work. It is for animation feedback, not for the final render. It is a short step I find works well for me, and makes me feel pretty. The actual fading in and out will occure through the shader assigned to these particles.
Ok, now that we have half a bottle of whiskey in us, weíre almost done with the animation. All we need to do now, before we render the first pass, is to assign a cloud shader to these particles and actually give it the opacity talked about above.
In the Multilister (I prefer it over the Hypershade for these general things), I choose Edit>Create and pick Particle Cloud. I adjust the newly created Particle Cloud to give it a gray color, a density of 0.744, and a slight incandescence. Figure 8.
||The fade in and out of the breath I need to control through this shaderís Transparency attribute. To that end I attach a ramp to it by clicking the Map button to the right of the attribute in the editor and choose a ramp texture. I have adjusted my ramp as in Figure 9 to get the best fade in and out and general opacity settings for this simulation. Keep in mind, a colder climate will allow you to see more of the breath than a less cold one, so you can make that adjustment here in the shaderís Transparency along with the emitterís Rate.|
I will then run a few test renders and tweak all the shader settings and ramps to get the breath to look right. Once I do that, Iíll render it out without the background and take it into a composite program like After Effects and mix it into the back plates, fine tuning the transparencies and color. And that should do it. A bottle of whiskey and about an hour later, youíve got whiskey breath and she's got cold breath.
My thanks to Eyewire.com for their clip of these two lovely ladies, and their fabulous assortment of motion graphics and everyday animated clips. I'm all titillated just thinking about them!!
Copyright © 2001 by Dariush Derakhshani. All rights reserved. Images used by permission for educational tutorial.