Post 1 of 30
Creating realistic fire in EffectsLab and VisionLab
In order to assist my fellow users in harnessing the full power and potential of the particle engine in EffectsLab and VisionLab, I have put together this epic tutorial which takes you through all of the particle engine features while creating a realistic fire effect.
Click the image for a preview of the finished shot:
In this tutorial, we will cover only the flames which are used in the above clip. I hope to cover the smoke aspects in a future tutorial.
Standard text will explain the various functions of the particle engine.
Bold text will be used for the specific instructions involved in creating our Fire effect.
Red text will be used when we are discussing the physics and other behavioral aspects of real fire. Understanding how real fire moves is crucial to creating a convincing effect.
First you'll need the this background image. Once you have downloaded it, start a new project, import the image and place it on the timeline.
We will place our fire so that it appears to be coming out the low foreground window. Increase the Scale until the image is wide enough to fill the frame, and adjust it until you like the framing.
Now add a bare particle effect engine to the timeline, and let's take a look at the controls. I suggest making the effect 100 frames long, but you can use any length you want. More frames will take longer to render, of course.
The toolbox will change to display all the particle engine controls.
The Texture Browser
Here you have full control over the most defining visual aspect of your particle effect.
Textures are images that are used to draw each individual particle that comes from your emitter. When you add a bare particle effect to your timeline (ie, not a preset), it has no textures applied.
Instead there is a red cross placeholder marking the location of each particle. Once you import some textures, the red crosses will be replaced by the images.
All of the textures you import are shown in a list in the Texture Browser. You can import new textures by clicking the blue folder icon.
Clicking on the white 'i' symbol next to each texture name will display a preview of the texture image. To remove a texture, right-click on its name in the list and select “Delete”. As of version 937, you can have up to 10 textures in each particle effect.
There are several parts to a burning fire. The main part of the fire is very bright, nearly white, and has a fairly constant mass, which moves about a bit. Beyond that, there are the seperate flames that lick up and outward. These are typically not quite as bright, with a bit more orange, red or yellow color to them. In addition to that, there will be sparks and embers that spit up out of the fire, or are carried up by the rising hot air currents.
For the Flame effect, I used 5 textures which I created myself. You can download them from here, then import them into your effect. Four of the textures I used are flames, created from photos of my fireplace. The other is a sparks texture, to serve as the rising sparks and embers.
At the bottom of the Texture Browser area there is a control for how the textures are applied. The options in the menu are Single, Animated, and Animated (random start).
Single means that each particle will use a single texture file throughout its lifetime.
Animated allows you to use animated textures, or sprites, on your particles. This means that for every particle that is generated, its first frame will receive the first texture file, frame 2 will receive the second, and so on, until the end of the list of textures. At this point it will start over at the first texture. In order for this to work well, generally your texture files have to be set up to create a looping animation.
Animated (random start) is similar to the animated setting, except that it does not always start at the first texture on the list. Each particle starts at a random texture in the list, then loops through all of the textures, as mentioned above.
Set the Texture controller to Single.
• Using multiple textures can give greater depth and realism to your effect.
• Textures will greatly slow down the rendering time of the canvas. When working on the placement and movement of the particles, you can turn the textures off temporarily by using the Preview Emitters option in the Canvas menu. Once the particles are moving the way you like them, you can turn Preview Emitters off to see how the particles work with the textures again.
Turn Preview Emitters on now. Your Texture Browser should look like this:
This section of controls allows you to adjust the location of the emitter, the source of the particles, and how the particles will react once they have been emitted.
There are two types of emitters available.
Point emitters are, not surprisingly, a single point on the canvas from which the particles spew forth.
Rectangle emitters, as I'm sure you've worked out by now, are rectangular shapes from which the particles are generated. The size and aspect ratio of the rectangle are completely adjustable.
Both types of emitter can be moved about the screen simply by clicking and dragging them to where you want.
IMPORTANT: You cannot change from a point emitter to a rectangular emitter without losing all of the keyframe information which you have set. Be sure to select the appropriate emitter type before you start creating your effect.
We will use a Rectangle Emitter for our fire. Place the emitter slightly low and to the left of the window. Later we will add masks to make it appear to be coming from inside.
Fire needs oxygen to burn, that is why flames would shoot out of our window. As the oxygen in the building is used up, the flames reach up and out to find more.
Immediately below the Emitter Type selector are two read-out windows which will show the location of a point emitter on the canvas. If you are using a rectangle emitter, they will be blank. The first read-out shows the location on the X-axis, measured in pixels, from left to right of the frame. The second window is the location on the Y-axis, measured in pixels, from top to bottom.
Tween StrengthThe Tween Strength slider controls the smoothness of the transitions between each keyframe. With Tween Strength at 0, the emitter will follow a straight line from one keyframe to the next. With Tween Strength at 1.00, the program will create a gradual curve which intersects each of the keyframe points you have set. This provides much smoother motion, and avoids sudden and obvious changes in direction.
Relationship to Origin Point
The final attribute for the position of the particles controls how they relate to the emitter after they are emitted.
Free From Origin means that once the particle is emitted, it will follow its set trajectory until the end of its lifetime, regardless of how the location of the emitter changes afterward.
Stuck To Origin means that their relationship to the origin point remains constant, so that if the emitter moves, the particles will follow it. If the emitter spins, the particles will spin around the center point of the emitter.
To make our fire move smoothly, we will increase the Tween Strength to 1.00. Set the particles to Free from Origin, so our fire will move freely once it is emitted. Make sure Position controls now match this picture:
Here we can set how many particles we are dealing with and what direction they will travel, among other things. First off, we set whether there are any particles being created at all.
A very basic control, this one! When the emitter is On, particles will be generated. When it is Off, no particles will be emitted. Turning off the emitter has no effect on the particles which are already in existence.
We want our fire to burn continuously, so leave the switch ON through the entire effect.
Controls the maximum number of particles that can be in existence at any given time. If the Particle: Max is 500, then once 500 particles are created, no more particles can be emitted until some of the existing particles reach the end of their lifetime and disappear.
We won’t be using huge amounts of particles, so you can leave the Max set to 500.
Controls how many new particles are created each frame.
For this effect, we will only need a Particle Rate of 4.
Controls how long (in frames) the particle will last before it disappears. This also has a big impact on many of the other settings, which I will go into below.
In my NTSC project, I used a Particle Lifetime of 33 frames. If you are on PAL, you may need to take the difference in frame rate into account and reduce the lifetime a bit. Try 27 frames.
Next in the Particle Creation controls we have a menu where we can select the reference point for the angle of our particle emission.
Relative to Canvas means that 'up' is the top edge of the canvas.
Relative to Animation means that as the emitter moves around the screen, the direction that the particles register as 'up' will relate to the direction in which the emitter is moving.
So if you animate your emitter moving from the top left to the bottom right of the screen, with Relative to Animation selected, and the emitter rotation is set to zero, then the particles will emit at an angle toward the top left corner.
Our fire emitter won’t really move around the screen, so Relative to Canvas will suit our needs just fine.
• For creating trail effects, such as a missile or comet tail, use the Relative to Animation option. It will cause the emission to always follow your emitter, wherever it moves.
Direction of Emission
In the middle of the Particle Creation controls, you will see a circle with a small diamond in it. This Direction Wheel is used to set the direction in which the particles will be sent forth.
Simply click on the diamond and drag it in the direction of your preference. For example, if you want the particles to move toward the right side of the screen, drag the diamond to the right hand side of the Direction Wheel. The three readout windows will tell you the angle of your trajectory.
Absolute is the angle in relation to the canvas, in degrees.
Relative is the angle relative to the animation, in degrees.
Turns will tell you how many times you have made a complete rotation, in a percentage.
We want our flames to appear to be coming up and out of the window, so set the Emission Angle to an angle up and slightly to the right. The Absolute angle is 23.24 in my settings.
Once you have the direction set, you can use the Angle Range control to adjust the width of the particle stream. The readout is in degrees to either side of your direction. So if you set the Angle range to 10, you will get a stream of particles 20 degrees wide, centered on the direction you have selected using the circular direction control.
We mostly want our flames to go up, without spreading very much in width, so we will use a fairly low Angle Range of 13.
• For emissions that are intended to come toward the camera, use an angle range of 180, to get the particles to emerge in every direction.
The Scale adjusts the overall size of the entire effect. This means that it alters not only the size of the particles, but the relative distance between them, and the size of the overall path that they will follow throughout their lifetime. Later we will work with a control that adjusts only the size of the particles themselves.
Let’s reduce the scale slightly to tighten up our effect, and match the overall size of the effect better to our background. A Scale of 0.80 should do nicely.
Draw In Front/Behind
At the bottom of the Particle Creation section is a menu with two options.
Draw New Particles Behind means that new particles will appear behind the existing particles. This can often be useful for hiding the actual appearance of the particles, if your emitter is visible.
Draw New Particles In Front means that new particles will appear in front of the existing particles, therefore the actual creation of each particle will be visible.
Setting this to Draw New Particles Behind will make the flames appear to be coming toward us, out of the window. The Particle Creation section of your controls should now look like this:
Particle creation tips:
• Drawing new particles in front can be used to make the emitter point away from you.
• Draw new particles behind can make the effect seem to be coming toward the screen.
Here we can adjust and alter the actual appearance of each particle over the course of its lifetime. This is the meat of the engine.
Each particle has a texture or sprite that is applied to it, as we have already discussed, but we can also set the color, opacity, speed, and size of the particle throughout its lifetime.
The first control deals with the color and the opacity of the particles.
Click on the Color/Opacity bar to open its editing widget. In this window you have two bars. The top bar is a gradient from white to black and the bottom bar is solid red.
The left end of each bar represents the beginning of the particle's lifetime. The right end is when its lifetime ends.
Look below the bottom left corner of the red Color Gradient and you will see a small red handle. This is a control point on the gradient. Click the handle to select it, then click the box labeled Color: to open the Color Picker.
Here you can select any color you want to give your particles. Pick a color, and click OK to close the color picker. You can click anywhere within the red bar to create a new control point. Each control point can be assigned any color you like, and can be placed anywhere on the color bar.
The Location readout at the bottom of the widget will tell you where your current Control Point is, in a percentage of the particle’s lifetime.
The Opacity Gradient works similarly to control the opacity (transparency) of each particle over the course of its life. Above the Opacity Gradient you will see two control points; a white one on the left, and a black one on the right. Clicking on one of them will enable the Opacity Slider at the top of the widget.
The value readout will tell you how opaque you are at the current setting. 0% means that the particles are completely transparent, and 100% means they are completely opaque. Notice that in the opacity gradient, full opacity is represented by white, and full transparency by black.
In each gradient, you can have up to 20 control points.
The color and opacity gradients are critical to the quality of our finished fire effect. If you want to be adventurous, try to get your gradients to match this picture.
If you prefer to be exact, use these settings for your control points.
OPACITY GRADIENT: 3 CONTROL POINTS
1: Value 100%, Location 0%
2: Value 16%, Location 89%
3: Value 4%, Location 100%
COLOR GRADIENT: 4 CONTROL POINTS
Getting the colors close should be enough, if you can’t get them exact.
1: Location 0%, Red 240, Green 164, Blue 104
2: Location 38%, Red 240, Green 124, Blue 18
3: Location 89%, Red 240, Green 94, Blue 2
4: Location 100% Red 255, Green 0, Blue 0
Guess what? The Color Randomizer controls the randomness of the color assigned to the particles. If you want the particles all to be the exact color you assigned them in the Color Gradient, leave this control at 0. For a bit more variety in the color, which can sometimes help add realism to the effect, you can turn up the Randomizer.
If we set the Color Randomizer to 0.29, we should be able to get a bit of variety in the colors of our flames, without introducing entirely new hues such as blue and green.
• Using a low setting on the Color Randomizer, you can retain the overall color tone of your effect, while still adding a bit of variety for greater realism.
• Color Randomizer settings do not affect the relative changes over time you have set in the Color Gradient. The first control point color will be randomized, and the relative change between its color and that of the second control point will be retained. For example, if you set the Color Gradient to transition from red to light red, and the randomizer assigns a particle a purple color, that particle will transition from purple to light purple.
Basically works the same as the Color Randomizer, but for the opacity. Opacity Randomizer settings do not affect the relative changes over time you have set in the Opacity Gradient. The opacity of the first control point will be randomized, and the relative change between each subsequent control point will be retained.
Real flames have a fairly large variety in their opacity, so we can set the Opacity Randomizer fairly high. I used a setting of 0.54, but you might be able to higher if you want.
The Speed Curve intially appears as a straight line. Similar to the gradients for color and opacity, it represents the lifetime of the particle, from left to right.
Click on the curve to open its editing widget. You should be familiar with the control point concept now, so you will notice that this curve basically edits the same way as the color and opacity gradients.
Click anywhere in the curve to create a new Control Point, then drag the Value Gradient slider to set the speed for that point. You can have up to 20 control points in the Speed Curve. The speed Value is in pixels per frame.
For this particular effect, we want our flames to continue at a consistant speed, until the very end of their lives, where we will speed them up a bit to give them a bit of a snap. This will make the fire more active and energetic. Set the first Control Point to Value 1.8690, Location 0%. Now click to add another Control Point, and set it to Value 2.8030, Location 95%. Now add a third, drag it all the way to the end, at Location 100% and set its Value to 7.4750.
A fire of this size uses a lot of oxygen. As it burns the oxygen inside the building, it begins to choke itself, so it grabs at the oxygen outside. As the air outside is heated by the fire, it rises. These processes are what makes the fire reach up and outward so quicky, as opposed to a small campfire, which has plenty of oxygen, and burns at a slower, more lazy pace.
Paired with the Speed Curve you have the Speed Randomizer, which makes the initial particle speed more variable. Each particle will still follow the speed curve, based on its individual starting speed.
Flames move at widely varying speeds, so keep the Speed Randomizer set high. 0.61 at least, you may want to go higher.
Works the same as the Speed Curve but affects the size of the individual particles. Up to 20 Control Points can be set in the Size Curve, to alter the size of an individual particle over the course of its life.
Use the Value Gradient slider to set the size value for each control point. The size value is a percentage of a full-size (512x512 pixel) texture. So at 25% each particle texture will register at 128x128 pixels on your footage.
We don’t need our flame size to change much, so we will leave the curve as a straight line. One control point, Value 0.2000, Location 0%, is all we need.
The Size Randomizer sets the randomness of the particles at the start of their life. Each particle will still grow or shrink according to the relative settings in the speed Curve.
A wide variety in the size of our flames is a good thing, so use a setting of 0.61 on the Size Randomizer.
Here you can set how the particles are blended into each other, as well as the underlying layers. Normal means that the colors of your particle effect will not be altered. Add and Screen are designed to be used with effects which create a light source, such as fire, or some magical effects.
In reality, the more flames you have, the brighter the fire is going to get. To realistically simulate this, set the Blend Mode on our flame effect to Add. This will let our flames composite properly onto each other when they overlap, and composite properly onto the background. Now you should have Particle Properties controls which match this:
You now have all of the basic settings for your fire. Go to the last frame of your effect, and set the Out Point for your clip by pressing 'O'. Turn off the Preview Emitters in the Canvas menu, and Preview render your effect (click the RAM button on the Top left of the timeline).
Take a look at your newly-kindled fire.
Now we will use Gravity and some additional keyframing animation to make the flames move a bit more realistically. You may want to return to your Preview Emitters before we begin editing once again.
You can use Gravity to pull your particles in a given direction after they are emitted. It can be used to pull them downward, and thus simulate actual gravity, or you can set it to pull them sideways, to simulate the effects of wind, for example. Use the Direction Wheel to set the direction toward which gravity should pull.
The Gravity Strength slider adjusts the strength of the gravity’s pull. This will determine how quickly it affects the particles after their emission, and how quickly they move in the direction gravity is pulling them.
When you have a fire near a wall, the fire (and smoke) will, in general, automatically hug the surface of the wall as they rise. Some of the smoke will often wander about, but the majority of it will stay near the wall surface.
To simulate this behavior, we will use the gravity controls to pull them upward. Set the Direction Wheel in the Gravity controls to straight up, or just barely off to the right of straight up. I have it at an Absolute angle of 0.38.
We want the gravity to pull the flames upward, but not too fast. Set the Gravity Strength to 0.07. Turning up the gravity too far would cause the particles to start moving in their new direction too soon after their creation, and at too great a speed. Keeping it low means that it will still have an effect, but not until their original momentum has carried them out of the window.
Another trick that we can now use, with this gravity in place, will give more movement to our flames. The pull of gravity will keep all of the flame particles moving in the same general direction, so by varying the direction of our emitter, with the Direction Wheel in the Particle Creation settings, we can get a lot more variety in the direction of the individual particles.
This step will get too involved for me to provide specific data for each keyframe, so here is the basic procedure. At random intervals on the timeline, we will alter the direction of the flame emitter. I used intervals of anywhere from 3 to 35 frames or so, and waved the emitter back and forth to arbitrary angles ranging roughly from -5 degrees to 90 degrees, Absolute.
Look at the Inferno preset to see more specifically how this works, if you are unclear. Once you have these keyframes set, your particles are pretty much finished. Now we just have to place them in the window. Preview render again, and have a look at your work.
Masking the flames
The masking system that is built into EffectsLab and VisionLab is ideal for making our fire appear to be coming from inside the window. Due to the perspective on the building in this shot, we will need to mask the left side of the window, and the bottom of the window, across the sill.
We will use two seperate Masks for this procedure. The reason for this is that the flames will have a fairly hard edge across the bottom, where they come up from the sill. But on the side, where there will eventually be smoke coming out as well, they will need a softer edge to blend more with the smoke.
So draw your first mask in the same shape that you see in this image.
The only really important part is that the top edge of the mask follows the edge of the sill properly. Click on the necessary points, drag the last point onto the origin to close the mask, and then click the Animate tab in the Mask Shape Inspector.
In the Animate controls for the Mask, we can adjust the Feather (softness) of the edge, and the Transparency of the entire mask. These can be animated to change over time using keyframes.
Also, we can change the shape of the mask at any time by simply dragging the control points of the mask around on the Canvas. We won’t need to animate our mask, but it is a very useful feature for other projects.
For the bottom edge of the window, we want the edge to be fairly sharp, but not jaggy, so we will add just a slight bit of Feather to it. I set the Feather to 6. We want the mask to completely block the flames, so we will keep the Transparency set to 100.
Now we will add another mask, for the left side of the window. Create a shape like the one in this picture.
Notice that along the lower half of the window, the mask closely follows the edge. As the flames rise though, it is possible that some of them would come out around the frame of the window opening. To allow for this, we can gently curve the mask back away from the window as we get higher. Set the control points for this mask where you see them in the picture, and then raise the Smooth Points control to 0.61. This smooths out the curves, and eliminates any unnatural corners in the mask shape.
Now click the animate Tab, and set the Feather to 21.
And there you have it. The flames are all set, the window is masked, and you are ready to render the effect out and see how it looks.
Grading the flames
We will now use the grading controls to further enhance our flame effect. Click on the Grade timeline track for your effect to switch the toolbox to the grading tools.
To smooth our flames out a bit, and blend the particles together more realistically, we will use a bit of blur. There are a number of different blur filters to choose from, including Blur: Angle, Blur: Gaussian, Blur: Radial, and Blur: Zoom. In our case, the reason the flames require some blurring is that they are moving. To simulate a motion blur, we will use the Blur: Angle filter.
Using the Direction Wheel, set the angle of your blur to the general direction the flames take as they come out of the window. I used an Absolute value of 20.23. We don’t want a lot of blur, just enough to blend the individual particles into one single fire entity. Use a Strength of 4 to achieve this.
Every object on the timeline has additional properties you can access by clicking its main title in the track listing. The toolbox will change to show general information about the clip. A few of the settings can be altered.
Composite blend mode
In the Composite menu, set the Composite Blend Mode to Lighten. The initial effect on the flames is fairly subtle, but when you eventually add smoke to the effect, it will help the fire and smoke blend together more convincingly.
Now it is time for one final render, and see how your flames look. Of course, they would look better with some smoke. I hope to do a tutorial on smoke eventualy, but in the meantime, you can download the smoke presets I have created and give them a try, or, if you are up to it, feel free to try create your own smoke.
Hopefully at this point, you have a better understanding of how the controls in the particle engine work. So, if you see any aspect of the effect that needs adjusting, or you feel you could improve it in some way, I strongly encourage you to try it.
Get back into the Emitter Attributes and try making some changes. Maybe you want the flames to go a bit faster. Perhaps you want to try a more complicated effect, where the sparks are created and controlled by their own seperate emitter. Perhaps you think they are too bright and want to bring a bit more color into the effect. Maybe you want to introduce some additional textures, or replace some or all of the textures entirely.
By all means, give it a try. Getting in there and seeing what happens when you make changes is the best way to get a feel for the controls. And don’t forget to submit the effects you come up with to the Presets Library on the site, so the rest of us can use them, too.