To begin, call up the scene house.mb in Maya.

First we'll break up the house into pieces of debris that'll be blown off by the explosion. There're two methods to do this: the safe, controlled and slow method, or the other - contrasting in every aspect - method. We'll use the former because it'll give us some insight into the temperament of Maya's dynamics system. By the way, the faster method is by using Dynamics ··> Effects ··> Create Shatter.


Creating the debris

Turn off construction history.

Go into component selection mode, turn on poly faces selection mask, and select the three polygons between the door and left window, as shown below.

Turn on Polygons ··> Tool Options ··> Keep Faces Together, and then run Edit Polygons ··> Extract (options), with Separate Extracted Faces turned on. The house object is thus split up into a group of two component objects. Ungroup them and select the smaller object. Rename it for easy identification.

Call Modify ··> Center Pivot. Then select the Move tool and type 0 0 0 in the Numeric Input: Absolute field. Note down the translation values in the channel box, call Modify ··> Freeze Transformations, and then translate the object back to its original position by using the negatives of the noted translation values.

MEL-savvy animators may like to know that the whole procedure after the last illustration can be represented by the following script:

string $sel[], $par[], $child[], $cmd;
int $numsel, $i;
float $xpos, $ypos, $zpos;

$sel = `ls -sl`;
$numsel = size($sel);
$cmd = "polyChipOff -kft on -dup off -ch off";
for( $i = 0; $i < $numsel; $i++ ) $cmd += " " + $sel[$i];
eval($cmd);
$par = `listRelatives -p $sel[0]`;
$child = `polySeparate -ch off $par[0]`;
$par = `listRelatives -p $child[0]`;
ungroup $par[0];

$xpos = eval("getAttr " + $child[1] + ".boundingBoxCenterX");
$ypos = eval("getAttr " + $child[1] + ".boundingBoxCenterY");
$zpos = eval("getAttr " + $child[1] + ".boundingBoxCenterZ");

select $child[1];
rename Debris1;
move (-$xpos) (-$ypos) (-$zpos);
makeIdentity -a true;
xform -piv 0 0 0;
move $xpos $ypos $zpos;

Continue breaking off as many pieces of debris as you want before continuing with the tutorial.


Creating the dynamics

  1. Set the animation playback speed to free (via Window ··> Settings/Preferences ··> Preferences ··> Timeline). It's important to set this because Maya's dynamics system computes an object's position in the current frame based on its position in the previous frame during playback. If the playback skips frames, the computation would be disrupted, causing the object to drift off-course.

  2. Switch to the Dynamics menu set. Select the ground plane, and call Soft/Rigid Bodies ··> Create Passive Rigid Body (options) with the following settings:

    Rigid body name: rigidbody0
    Static friction: 0.8
    Dynamic friction: 0.8
    Bounciness: 0.5
    Stand-in: none
    Collision layer: -1

    Unmentioned parameters should be left at neutral values (check boxes unchecked; mass and scale values set to 1; other numbers set to 0). This also applies to all option sets below.

  3. Open Solvers ··> Rigid Body Solver and set

    Step size: 0.01
    Collision tolerance: 0.01
    Start time: 10
    Solver method: Runge Kutta Adaptive

    These solver settings are slow to compute, but yield fine results. Because we'll be working with only a few simple objects, the speed penalty wouldn't be severe.

  4. Unselect the ground.

  5. Create a Fields ··> Gravity (options) with

    Field name: gravity1
    Magnitude: 40
    Direction: 0 -1 0

    and a Fields ··> Drag (options) with

    Field name: drag1
    Magnitude: 0.2

  6. Pick a piece of debris, and call Soft/Rigid Bodies ··> Create Active Rigid Body (options) with the following settings

    Rigid body name: rigidbody1
    Static friction: 0.5
    Dynamic friction: 0.5
    Bounciness: 0.3
    Stand-in: none
    Collision layer: 1

  7. After rigidbody1 is created, go over to the channel box and set its

    initialVelocityX: -1
    initialVelocityY: 8
    initialVelocityZ: 28
    initialSpinX: 400
    initialSpinY: -150
    initialSpinZ: 0
    applyForceAt: CenterOfMass

  8. Use Window ··> Relationship Editors ··> Dynamic Relationships to link the debris object to gravity1 and drag1.

  9. Playback the dynamics simulation. Try changing the initial velocity and spin of the debris and see the effect on the simulation. Switch to real-time playback (Window ··> Settings/Preferences ··> Preferences ··> Timeline ··> Playback Speed ··> Normal) momentarily to see if the speed of the simulated motion is OK.

    If you're happy with the motion, then select the debris object, highlight its translation and rotation channels in the channel box, and run Edit ··> Keys ··> Bake Simulation (options):

    Hierarchy: selected
    Channels: from channel box
    Time range: start/end
    Start time: 10
    End time: the last frame in the timeline
    Sample by: 1
    Disable implicit control: on

  10. When the baking is done, run Edit ··> Delete by Type ··> Rigid Bodies. You thus convert the simulated motion into keyframes. This makes for easier adjustment of motion, and also allows faster playback later when you have a large number of debris.

  11. Numerical error in the dynamics computation could cause the debris to tremble while it's resting on the ground. To rectify this, open Edit ··> Keys ··> Delete Keys (options), make sure the debris' translation and rotation channels are still selected in the channel box, and set

    Objects: selected
    Hierarchy: selected
    Channels: from channel box
    Time range: start/end
    Start time: when the trembling starts
    End time: the last frame
    Method: keys
    Adjustment: none

    You may also want to run a Curves ··> Simplify Curve (in the graph editor) on the debris' channels to remove unnecessary keyframes.

  12. Pick another piece of debris and repeat steps 6 to 11 for it, varying the initial velocity and spin randomly within the following ranges.

    initialVelocityX : -5 -> 5
    initialVelocityY: 10 -> 20
    initialVelocityZ: 20 -> 33
    initialSpinX: -440 -> 440
    initialSpinY: -360 -> 360
    initialSpinZ: -200 -> 200

    And also make sure in step 6 to set the collision layer to a different number for each piece of debris.

If all these steps sound awfully tedious to you, you might want to use the following MEL script to automate the process. Note that steps 9 - 11 are left out of the script so that you can make minor adjustments to the rigid body parameters before committing the simulation to keyframes; anyway, you can bake simulation for multiple selected objects simultaneously.

string $sel[], $rbname, $atname;
int $numsel, $i, $num;
float $xvel, $yvel, $zvel, $xspin, $yspin, $zspin;

$sel = `ls -sl`;
$numsel = size($sel);
for( $i = 0; $i < $numsel; $i++ ) {
	$atname = $sel[$i] + ".translateX";
	$xvel = `getAttr $atname`;
	$yvel = rand(10,20);
	$zvel = rand(15,30);
	$num = $i + 1;
	$rbname = "rigidbody" + $num;
	select $sel[$i];
	rigidBody -n $rbname -l $num -sf 0.5 -df 0.5 -b 0.3
		-afa centerOfMass -iv $xvel $yvel $zvel;
	$xspin = rand(-440,440);
	$atname = $rbname + ".initialSpinX";
	setAttr $atname $xspin;
	$yspin = rand(-360,360);
	$atname = $rbname + ".initialSpinY";
	setAttr $atname $yspin;
	$zspin = rand(-200,200);
	$atname = $rbname + ".initialSpinZ";
	setAttr $atname $zspin;
	connectDynamic -f gravity1 -f drag1;
}

Note that the script can work on multiple selected transform nodes.


Some debris fall through the ground...

and some debris tumble along the ground incessantly. Such problems are due to the dynamics system's inaccuracy in computing collision between flat objects that have no volume. To solve the problem, use a thin cube in place of the debris to do the simulation, and then parent the debris under the cube.

  1. Switch to the modeling menu set, and rewind to the first frame.

  2. Select one of the errant debris. If it has a rigid body node, run Edit ··> Delete by Type ··> Rigid Bodies. If it has animated translation and rotation channels, delete them.

  3. Duplicate the debris.

  4. Switch to poly faces component selection mode, pick the duplicate debris' only polygon, and run Edit Polygons ··> Move Component (options)

    Local translate: 0 0 -0.01

    followed by Edit Polygons ··> Extrude Face (options)

    Local translate: 0 0 0.02
    Divisions: 1

  5. Make the resulting slab an active rigid body and run it through dynamics simulation as before - don't hesitate to use the MEL script, now that you know what it does; it's never a good idea to use scripts and plug-ins blindly.

  6. Make the slab's shape node a template so that it won't be visible in rendering.

  7. Rewind to the first frame, and parent the original debris under the slab (with preserve position turned on).

Here's a MEL script that encapsulates steps 3 to 7 (again the simulation-baking is left out). You can use this script like the previous one – by running it on a bunch of selected objects. Take note that you should only use this script on flat single-polygon objects.

string $sel[], $facen, $proxyn[], $shapen[];
int $numsel;

$sel = `ls -sl`;
$numsel = size($sel);
for( $i = 0; $i < $numsel; $i++ ) {
	$proxyn = `duplicate -n proxyrig1 $sel[$i]`;
	$shapen = `listRelatives -s $proxyn[0]`;

	$facen = $proxyn[0] + ".f[0]";
	polyMoveFacet -ltz -0.01 -ch off $facen;
	polyExtrudeFacet -ltz 0.02 -ch off $facen;

	$atname = $proxyn[0] + ".translateX";
	$xvel = `getAttr $atname`;
	$yvel = rand(10,20);
	$zvel = rand(15,30);
	$rbname = "proxyrb" + ($i + 1);
	select $proxyn;
	rigidBody -n $rbname -l ($i + 9000) -sf 0.5 -df 0.5
		-b 0.3 -afa centerOfMass -iv $xvel $yvel $zvel;
	$xspin = rand(-440,440);
	$atname = $rbname + ".initialSpinX";
	setAttr $atname $xspin;
	$yspin = rand(-360,360);
	$atname = $rbname + ".initialSpinY";
	setAttr $atname $yspin;
	$zspin = rand(-200,200);
	$atname = $rbname + ".initialSpinZ";
	setAttr $atname $zspin;
	connectDynamic -f gravity1 -f drag1;

	eval( "setAttr " + $shapen[0] + ".template" + " 1");
	move -a 0 0 0 $sel[$i];
	parent -r $sel[$i] $proxyn[0];
}

Flaming debris

Pick all the debris objects, and run Particles ··> Emit from Object (options), with

Emitter name: emitter1
Emitter type: surface
Rate: 500
Speed: 2.5
Speed random: 1
Tangent speed: 0.5
Normal speed: 0.5

A particle object will be created along with the emitters. Name it debrisfire and set its attributes thus:

Lifespan mode: random range
Lifespan: 0.2
Lifespan random: 0.1
Start frame: 10
Particle render type: multistreak

Click on Add Attributes For Current Render Type and then set

Color accum: on
Line width: 2
Multi count: 20
Multi radius: 0.42
Tail fade: 0
Tail size: 3
Use lighting: off
Casts shadows: on
Primary visibility: on

Under the Add Dynamics Attributes section, press the Color button and choose Add Per Particle Attribute. A new attribute called rgbPP will appear in the Per Particle (Array) Attributes section; right-click on its field and choose Create Ramp; then right-click on it again and choose Edit Ramp. Make the ramp

Type: v ramp
Interpolation: exponential down



Color gain (under the color balance section): 0.14, 0.14, 0.14 (RGB)

Close the attribute editor, and while the particle object is still selected, create Fields ··> Uniform (options).

Field name: uniform1
Magnitude 8
Attenuation: 0
Direction: 0, 1, 0
Use max distance: off

Select the particle again, and create Fields ··> Turbulence (options).

Field name: turbulence1
Magnitude: 15
Attenuation: 0
Frequency: 3
Phase: 0, 0, 0
Noise level: 1
Noise ratio: 0.6
Use max distance: off


The flash

First, open Window ··> Settings/Preferences ··> Preferences. In the Keys section, set the default in and out tangents to linear.

Next, Create ··> Lights ··> Spot Light (options)

Intensity: 0
Color: 1, 0.95, 0.5
Cone angle: 110
Penumbra angle: 10
Dropoff: 0
Decay rate: 2
Cast shadows: on
Shadow color: black

Rotate the the created light around y-axis by 180°, and move it to (0, 4, -2.5).

Keyframe the created light's intensity to 0 at frame 8, 1 at frames 10 and 13, and then back to 0 at frame 16.

Open the spotlight's attribute editor and set

Depth map shadow (dmap) resolution: 512
Use mid dist dmap: off
Use dmap auto focus: off
Dmap focus: 120
Dmap filter size: 1
Dmap bias: 0.01
Fog shadow intensity: 1
Fog shadow samples: 30

Still in the attribute editor, scroll up to the Light Effects section, and click on the Light Fog map button . Set the resulting light fog to

Color: white
Density: 1
Color based transparency: on
Fast drop off: on
Leave the other attributes at their default values

Back at the spotlight's attribute page, set

Fog spread: 1.1
Fog inensity: 1


Sparks

Particles ··> Create Emitter (options)

Emitter name: SparkEmitter
Emitter type: volume
Rate: animate from 0 at frame 9, to 1100 at frames 10 and 11, and back to 0 at frame 12
Direction: 0, 0, 1
Speed random: 6
Volume shape: cube
Volume offset: 0, 0, 0
Die on emission volume exit: off
Away from center: 4
Along axis: 0
Around axis: 0
Random direction: 8
Directional speed: 15

Move the new emitter to (0, 3.7, 1.8), rotate it by (-20, 0, 0), and scale it to (4.5, 2, 0.1).

Pick the particle object associated with this emitter, and set its attributes:

Lifespan mode: random range
Lifespan: 0.7
Lifespan random: 0.5
Start frame: 10
Particle render type: tube
Click Add Attributes For Current Render Type
Radius0: 0.06
Radius1: 0.12
Tail size: 0.11
Casts shadows: off

Close the attribute editor. With the particle still selected, shift-select the ground, and run Particles ··> Make Collide (options).

Resilience: 0.5
Friction: 0.6

Use Window ··> Relationship Editors ··> Dynamic Relationships to link the particle to gravity1.

Lastly, we make the particle material: open multilister/hypershade and create a particle cloud with

Color (RGB): 1, 0.98, 0.8
Transparency (RGB): 0.1, 0.1, 0.1
Density: 1
Blob map: white
Roundness: 1
Translucence: 0.5
Noise: 0
Diffuse coeff: 0

Assign this material's shading group to the particle.


Fire burst

Particles ··> Create Emitter (options)

Emitter name: fireburst
Emitter type: volume
Rate: 0
Direction: 0, 0, 1
Speed random: 30
Volume shape: cube
Away from center: 0
Along axis: 0
Around axis: 0
Random direction: 30
Directional speed: 70
Scale speed by size: off

Move the created emitter to (0, 3.8, 0) and scale it by (4.5, 2, 0.5).

Keyframe the emission rate to 0 at frame 10, 4000 at frames 11 and 14, and back to 0 at frame 15.

Rename the particle shape associated with this emitter to fbparticles and set its attributes to

Lifespan mode: random range
Lifespan: 0.45
Lifespan random: 0.2
Start frame: 10
Particle render type: cloud
Casts shadows: off

Go to the Add Dynamic Attributes section and click on the General button; in the invoked Add Attribute window, go to the Particle section and choose radiusPP. Back in the particle attribute editor, right-click on the radiusPP parameter field and choose Creation Expression. Type in the following expression:

seed(fbparticles.particleId + 415);
fbparticles.radiusPP = rand(1.4,2.4);

While the particle is still selected, run Fields ··> Drag (options)

Field name: drag2
Magnitude: 7
Attenuation: 0
Use direction: off
Use max distance: off

Select the particle again, and run Fields ··> Uniform (options)

Field name: uniform2
Magnitude: 46
Attenuation: 0
Direction: 0, 1, 0
Use max distance: off

Select the particle yet again, and run Fields ··> Turbulence (options)

Field name: turbulence2
Magnitude: 17
Attenuation: 0
Frequency: 0.5
Phase: 0, 0, 0 (we're going to animate this)
Noise level: 1
Noise ratio: 0.65
Use max distance: off

Keyframe the new turbulence's phaseZ to 0 at frame 1, and to 1.5 at frame 150.


Shading the fire

In the multilister/hypershade, create a Particle Cloud material with the following parameters:

Color: to be textured
Transparency: same
Density: 0.5
Blob map: white
Roundness: 0
Translucence: 0
Noise: 0.8
Noise freq: 0.15
Noise aspect: 0
Noise anim rate: 0.05
Solid core size: 0
Diffuse coeff: 1
Surface color (RGB): 0.3, 0.3, 0.3
Translucence coeff: 0
Surface shading shadow: off

Texture the color parameter with a crater texture (with texture placement) that has

Shaker: 3
Channel1 (RGB): 1, 0.7, 0
Channel2 (RGB): 1, 0.3, 0
Channel3: black
Melt: 0
Balance: 0.6
Frequency: 2
Color gain (RGB): 1.4, 1.4, 1.4

Move the crater's 3D texture placement node to (28.7, 0, 0) and scale it by (2.3, 2.3, 2.3). Keyframe its y translation to 0 at frame 1 and to 50 at frame 150; keyframe its z translation to 0 at frame 1 and to 60 at frame 150.

Back to the particle cloud material - click the map button next to the Life Transparency parameter and choose a ramp (with texture placement). Set up the ramp as follows:

Type: v ramp
Interpolation: smooth



Color gain (RGB): 1.4, 1.4, 1.4

The completed shading network should look like

Assign this material to the last particle created above.


Smoke

Particles ··> Create Emitter (options)

Emitter name: smokeburst
Emitter type: volume
Rate: 600
Direction: 0, 0, 1
Speed random: 7
Volume shape: cube
Away from center: 0
Along axis: 0
Around axis: 0
Random direction: 7
Directional speed: 15
Scale speed by size: off

Rename the particle *shape* associated with this emitter to sbparticles and set its attributes to

Lifespan mode: random range
Lifespan: 3
Lifespan random: 1
Start frame: 12
Particle render type: cloud
Casts shadows: on

Add a radiusPP attribute like you did for fparticles and set its creation expression to

seed(sbparticles.particleId);
sbparticles.radiusPP = rand(1,2);

While the particle is still selected, run Fields ··> Drag (options)

Field name: drag3
Magnitude: 2
Attenuation: 0
Use direction: off
Use max distance: off

Select the particle again, and run Fields ··> Uniform (options)

Field name: uniform3
Magnitude: 15
Attenuation: 0
Direction: 0, 1, 0
Use max distance: off

Open the dynamic relationships editor and connect the particle to turbulence2.


Shading the smoke

Create yet another particle cloud material. Name it explosmoke.

Map its life color and life transparency to two separate ramps. Set the other parameters as follow:

Density: 0.5
Blob map: white
Roundness: 0
Translucence: 0
Noise: 0.8
Noise freq: 0.15
Noise aspect: 0
Noise anim rate: 0.05
Solid core size: 0
Diffuse coeff: 1
Surface color (RGB): 0.9, 0.9, 0.9
Translucence coeff: 0.4
Surface shading shadow: on
Filter radius: 5

If you've done the cloud tutorial, you should know that due to a software bug it's impossible to save the surface shading shadow parameter in an "on" state. In that tutorial we used a text editing hack to overcome the bug. Here, we'll use another trick: open Window ··> Animation Editors ··> Expression Editor, and choose Select Filter ··> By Script Node Name from its menu. Type a name (say, forceshadow) in the Script Node Name field, and type the following command in the large script area near the bottom:

setAttr explosmoke.surfaceShadingShadow 1

Mind the capital S's in ShadingShadow.

Press the Create button at the bottom. Choose Software Render for the Execute On parameter (located in the middle of the editor). The Script parameter should be set to Before. Close the editor. Now, every time Maya starts rendering this scene, it'll turn on explosmoke's surface shading shadow.

Going back to explosmoke's material settings, remember we mapped two ramps to life color and life transparency? Now set the life color ramp as follows.

Type: v ramp
Interpolation: smooth



Color gain (RGB): 3, 3, 3

The crater mapped to the bottom color should be

Shaker: 2.5
Channel1 (RGB): 1, 0.55, 0
Channel2 (RGB): 1, 0, 0
Channel3: black
Melt: 0
Balance: 0.25
Frequency: 2

Furthermore, scale the crater's 3D texture placement node by (1.5, 1.5, 1.5); keyframe its y translation to 0 at frame 1 and 23 at frame 150; keyframe its z translation to 0 at frame 1 and 26 at frame 150.

As for the life transparency ramp, set it to

Type: v ramp
Interpolation: smooth

The completed shading network should look like

And finally, of course, assign the material to the smoke particle created earlier.

At this point, you should run a playblast (mind the size!) to see how the animation is going. In particular, take note of the fire burst's staying time.


Lighting

To simulate the illumination from the fire burst, create a point light with the following settings.

Light name: explolight
Color: set to the expression

Intensity: keyframed to 0 at frame 10, 6 at frames 13 and 19, and 0 at frame 25
Illuminates by default: off
Decay rate: linear
Use depth map shadows: on
Dmap resolutio: 512
Use dmap auto focus: off
Dmap focus: 90
Dmap filter size: 2
Dmap bias: 0.01
Use XYZ± dmap: all on except Z+ dmap

Name the light's transform node Explolight; keyframe its y translation to 4 at frame 10 and 7 at frame 25; keyframe its z translation to 3 at frame 10 and 9 at frame 25. Leave its x translation at 0.

To simulate the illumination from the post-explosion fire, create a directional light with the following settings.

Light name: firelight
Color (RGB): 1, 0.6, 0
Intensity: set to the expression firelight.intensity = noise(frame/2)*0.1+0.6
Illuminates by default: on
Use ray trace shadows: on
Light angle: 0
Shadow rays: 1
Ray depth limit: 1

Name the light's transform node Firelight and rotate it by (90, 0, 10).

Create another fire light that's brighter and nearer to the house; make it a spot light this time with

Light name: strongfirelight
Color: to be mapped, described below
Intensity: animate from 0 at frame 11 to 1 at frame 17
Illuminates by default: off
Decay rate: no decay
Cone angle: 20
Penumbra angle: 10
Dropoff: 30
Use depth map shadows: on
Dmap resolution: 512
Use mid dist dmap: off
Use dmap auto focus: off
Dmap focus: 30
Dmap filter size: 2
Dmap bias: 0.13

Map the color parameter to a fractal texture with the following setting.

Amplitude: 1
Threshold: 0.2
Ratio: 0.3
Level min: 0
Level max: 4
Animated: on
Time: animated from 0 at frame 1 to 2.5 at frame 150
Color gain (RGB): 1, 0.5, 0
Invert: on

Go to the fractal's place2dtexture node and set

Coverage: 8, 8
Translate frame u: -2.5
Translate frame v: animated from 0 at frame 1 to -3 at frame 150

Name the spot light's transform node Strongfirelight, translate it to (-5, 25, 20), and rotate it by (-57, -20, 0).

Create one last light, a directional light this time with

Light name: keylight
Color (RGB): 0.73, 0.82, 1
Intensity: 0.8
Illuminates by default: on
Use depth map shadows: on
Dmap resolution: 1024
Use mid dist dmap: off
Use dmap auto focus: off
Dmap width focus: 60
Use light position: on
Dmap filter size: 2
Dmap bias: 0.13

Name this light's transform node Keylight, translate it to (50, 30, 78) and rotate it by (-20, 40, 0).

Open Window ··> Relationship Editors ··> Light Linking ··> Light Centric. Link Explolight to only Ground, Base1, Cyls1 and the house. Link Strongfirelight to everything except the particles.


Rendering

Rendering particles is never a straight-forward business in Maya (what is?). Take note of the following observations before we continue with the tutorial:

All these problems can be solved by rendering in different layers and then compositing them together later.

The rendering steps below should be done in the order in which they are presented - it's tedious, but Maya's current mechanism for pass-rendering is too limited for our needs...


Layer1: background and layer2: mainshadow

Hide all lights except keylight.

Hide all debris.

Modify ··> Disable Nodes ··> Particles.

In the render globals, turn off raytracing and turn on 3D motion blur. Turn on Enable Global Passes (located under the Render Layer/Pass Control section) - turn off beauty pass, and turn on color and shadow passes.

After the rendering is done, rename the color pass to background.# (# is the frame number) and the shadow pass to mainshadow.#. You might want to review the computer notes for instruction on how to do this.


Layer3: firecloud

Make visible firelight.

Hide the ground.

Turn on is dynamic for fbparticles and sbparticles.

Open the attribute editor for the material assigned to the house (should be lambert1) and set its matte opacity mode to black hole.

Open the attribute editor for keylight, and turn on use ray trace shadows (light angle = 0; shadow rays = 1; ray depth limit = 1).

In the render globals, turn on raytracing, turn off motion blur, and turn off Enable Global Passes. Make the file name prefix firecloud.


Layer 4: smokeshadow

Make visible the ground.

Turn off is dynamic for fbparticles. Turn off primary visibility (under the render stats section in the attribute editor) for sbparticles.

Set the house material's matte opacity mode to solid matte.

In the render globals, turn on Enable Global Passes, and turn on only the shadow pass.

Rename the rendered images to smokeshadow.#.


Layer 5: flash

Make visible the debris.

Modify ··> Disable Nodes ··> Particles.

Hide all lights except the flash light.

In the render globals, set the file name prefix to flash, turn off raytracing, turn on 3D motion blur, and turn off Enable Global Passes.


Layer 6: flamelight

Hide the debris.

Hide the flash light and make visible strongfirelight.

In the render globals, set the file name prefix to flamelight.


Layer 7: explodelight

Hide strongfirelight and make visible explolight.

In the render globals, set the file name prefix to explodelight.


Layer 8: sparks

Hide explolight and make visible keylight.

Turn on is dynamic in the spark particle.

Set the house and ground material's matte opacity mode to black hole.

Set the render file name prefix to sparks.


Layer 9: debris

Turn off is dynamic in the spark particle.

Hide all objects except the debris and keylight.

In keylight, turn on use depth map shadow.

In the debris' material, set matte opacity mode to solid matte.

Set the render file name prefix to debris.


Layer 10: debrishadow

Unhide all non-light objects.

Pick all the debris objects, and open Window ··> General Editors ··> Attribute Spread Sheet; under the Render tab, turn the whole column of Primary Visibility off.

In the render globals, turn on Enable Global Passes, and turn on only the shadow pass.

Rename the rendered images to debrishadow.#.


Layer 11: debrisfire

Turn on is dynamic in debrisfire.

Make sure your screen-saver is turned off. Run Rendering editors ··> Hardware Render Buffer. From the hardware render window's menu, choose Render ··> Attributes and set

Filename: debrisfire
Alpha source: luminance
Line smoothing: on
Geometry mask: on
Multi pass rendering: on
Render passes: 7
Anti-alias polygons: on
Edge smoothing: 3
Motion blur: 0

File name extension, start frame, end frame, by frame, image format and resolution should be set to match your software rendering.

From the same menu, choose Render ··> Test Render. Close and reopen the hardware render window, and then choose Render ··> Render Sequence.


Compositing

Using Shake, construct the following network:

If you're using other compositing softwares, note that the above network evaluates from top to bottom and from left to right. The invert function makes white image channels black, and vice versa. The other functions are the usual layering functions.