Roman Candle with Smoke

Posted by Duncan Brinsmead, 6 November 2012 9:08 pm

Download Scenefile:

This example scene shows how one can do a realistic simulation of a roman candle including smoke. The roman candle has balls that are shot out of a tube, and as the balls burn up they shoot out glowing embers and smoke.

Burning Balls

First create a particle system for the main balls. One can start with "nParticle:create emitter" using the cloud preset. Make the emitter type a volume, the rate around 6, and along axis to around 15. (this speed assumes that units are roughly defining meters)  AwayFromAxis and random direction can be used to keep all the particles from emitting straight up, but actually we probably want them mostly emitted up. The emitter can be scaled down to limit the region the particles are emitted from. On the particle system turn off "ignore solver gravity" (it defaults to on for the cloud preset). Set the lifespan mode ot constant and the lifespan to about 1.5. The particles should just start falling before they die. The drag can be zero or near zero as the balls are relatively dense. 

To simulate the random propulsive force acting on the balls resulting from non-uniform burning we can apply a volume axis field and use the turbulence settings. Make awayFromCenter zero and turbulence 1.0 and make turbulence speed 1.0, scaling up the field to cover the region the particles emit into. Turbulence frequency can be set to about 5,5,5 to make it more noisy. The particles should now diverge a bit from straight up but not too much. This effect is different from simply launching the particles in different directions.

Set the particle radius to a good value, perhaps 0.05.  The balls get smaller as they burn so we can set radius scale input to "normalized age" and edit the ramp to go smaller on the right. Opacity and Incandescence Input can also be set to "Normalized Age" and the ramps set to make the particle bright when burning then fading out before it dies. In this example I set the incandescence value high around 26 with a moderately saturated orangish hue (hsv = 22,0.8, 25.0). This roughly fakes the coloration that result from black body radiation of the hot particles. Because the color is not 100 saturated very high value levels become white, even though the hue is reddish orange. The color interpolates naturally to black going from white to yellow, orange then red. 


We can then add glow. The glow is important because the particles are much brighter than the camera or display device can show. If it could then the glow would happen in our eyes and we would not need to add it.  On the particle's shader "npCloudVolume" we can set the glowIntensity to something like 0.1. Then on the glow shader (shaderGlow1) set the quality to a high value (say, 100), as this is good for small point glow sources. Also turn off auto exposure as it will cause flickering.  I found a glow spread of about 0.01 and a halo spread of 0.05 worked well with glow intensity around 1.3 and halo intensity of 2.0, but you will likely need to tweak these values.  Note also that the glowThreshold can be raised such that one can have fully white particles that do not glow, while particles that are brighter than white will glow.


Now we can create the embers. Select the first particle system and do "nParticle:emit from object" and setup the particle system as for the balls, but with smaller particles and less intensity on the incandescence. A rate on the emitter of about 300 works OK with the emission speed at 0.4 and the particle lifespan set to about 1.3.  These embers are smaller and have more drag to the end of their life, so make the drag something like  0.1 and and the mass about 0.5. One can adjust the mass scale on the particle system so that the particles become lighter with age and thus fall more slowly due to the drag. Under emission attributes on the particle shape make the inherit factor about 0.3. This allows the embers  to get some upward motion from the main balls before falling down under gravity. 

Wind on Embers

To simulate a wind, select the embers particle system and create a wind field. On the wind field select the wind predefined setting, then make the magnitude about 100, speed 0.2 and attenuation 0.0. 


To create the smoke select the particle system for the balls and do "fluid: emit from object". Set the emitterType to Omni and the maxDistance to about 0.1 (or about the size of your particles). The rate will need to be high, about 1500, and motionStreak should be enabled. Also lower fluidDropoff to about 0.5. The fluid resolution should be high enough to capture the required detail, in my example I made size = 2,2,2 and baseResolution = 50. Set all boundaries to none so the fluid can more freely expand and set the autoResizeMargin to about 2. Make the transparency low but not zero.  For more detailed smoke set highDetailSolve to allGrids and make velocity noise about 0.03. 

To create an illusion of illumination of the smoke by the particles I used a dynamic temperature grid on the fluid, combined with a very high diffusion of 2.0 along with a dissipation of about 1.0. With such a fast diffusion one needs very high temperature emission. I used a heat/Voxel/sec of 50.0.  Then the brightness of the cloud can be set using the incandescence ramp.  The temperature diffuses out from the emitting particles a bit like light emitting, although there is some lag. Better might be  to use  several point lights with fast decay and no shadowing. A mel script could be used to position this pool of lights(10 might be enough) to match living particles and match the light color to the particle incandescence.

As well the temperature buoyancy and turbulence can add detail to the flow. 

Wind on Smoke

One could use the dynamic relationship editor one to apply the previously created airfield to the fluid to push it with the wind. However it is hard to independently control the magnitude of this for the fluid. As well it will tend to accelerate the fluid velocity over time. 

 Instead I applied a separate drag field to the fluid. The drag field works well with the fluid and we can use the inherit motion on the drag to create the wind. First we can animate the position of the drag field. In the attribute editor for the drag click in the translate X edit box and type "= time * 1.3".  This trick creates and expression for that attribute.  You can edit the expression( rightmouse over the edit box) and change the 1.3 to any desired speed for the wind. Make the attenuation zero so the drag affects everywhere equally and make InheritVelocity = 1.0, so the drag uses the animated position. The magnitude needs to be carefully set. Full drag occurs when the magnitude = framerate, for example 24.0. A value around 2 will nudge the fluid to move with the wind while allowing the fluid to flow with sub eddies. One can also add a very small amount of turbulence( on the fluid shape ) to make the flow more interesting.

Here is a render with the camera a bit closer

Refinements of this scene with smoke ground and self illumination can be found here.



Posted 7 November 2012 6:56 am

That is sweet!


Posted 7 November 2012 6:58 am

Heh heh heh... He said "burning balls".


Posted 7 November 2012 6:28 pm

another great example duncan
thank you

Maya Guru

Posted 12 November 2012 5:20 am

Respected Sir,

Pls help me whats the best way to reach you in open discussion forums for Maya Dynamics.I am a n Maya instructor from last 7 years and Certified Maya Professional i needs yours help to tackle some Fluids Doubts only.........

Duncan Brinsmead

Posted 12 November 2012 6:25 pm

If you post questions in the Maya Dynamics forum on CGTalk I will usually see them and respond when I can help.

Maya Guru

Posted 14 November 2012 1:03 pm

Hi friends i just needs help from you .I am using maya 3d fluids and calling particles to emit fluids when particles are allowed for as free fall on a floor i experienced some jitters or repeated patterns or bobby balls in the fluid .I then checked on Motion streak under emitter node but not quiet satisfactory.

I increased the solver values default from 20 to 30 i got some results better but when i changed the emitter options from omni to surface i start getting the same results .

Pls Mr.Duncan if you see my post pls give yours golden words i am looking forward to you sir.

Duncan Brinsmead

Posted 14 November 2012 5:51 pm

If emitting into a fluid from particles then changing the emitter type from omni to surface should have no effect. However it is good to set it to omni so the max distance is not greyed out. This is the radius of emission about each particle. It is possible your patterns are due to instability in the fluid resulting from your settings. Enable velocity display. If you get a huge velocity vectors in random directions then your simulation is unstable. In some cases increasing the substeps on the fluid will help.

However if you have problems, post them on CGTalk, and include an image as well as possibly a simple version of the scene showing the problem and I'll give it a look.

Maya Guru

Posted 14 November 2012 6:43 pm

Thanks A lot sir Its a Dream for an Instructor to Talk to you who are the actual Gods of Maya Fluids and Dynamics.

I will follow yours guidelines sir thanks for the time you gave to my post .......................


Posted 16 November 2012 3:52 am

Thank Duncan the Roman Candle is great, also wanted to say I have some students that are loving your Slag tutorial, fantabulous.

Ryan Todd

Posted 9 July 2013 3:41 pm

At the very start of your description you said that the numbers you were giving were to be applied to a scene that was set in meters. I have my scene set to meters but everything is still being build centimeters. What is the best way to change my scene and get everything to the proper scale?


Posted 12 August 2013 5:25 pm

Hello sir,
I am working on some fluids work and needed help. I have got some falling wood after burn and during the fall and collision with ground (and each other also), I need to emit embers from the wood.
What I did so far was, emitting particle from the falling wood with goal 1 so that it stay stick with the wood and when collide it emit particles and die.
What could be the best step for doing this. I used collisionGeometryIndex for collision test. This is the link for my WIP plz check and help me with the embers.

Falling wood

Thank you.

Add Your Comment

You must be logged in to post a comment.

Please only report comments that are spam or abusive.