##### Tutorial #3

In the previous tutorial we looked at some of the emitter properties that are accessible in the hierarchy window. We mentioned some properties such as tint color that we don’t yet know how to change, and we skipped over the particle type properties completely. In order to discuss these things, we need to open the emitter properties dialog.

We’ll need an emitter on the stage, but we don’t want to get too complex right now. So start a NEW project, select the Super Colorful library emitter, and add it to the stage.

There are four ways to open the emitter properties dialog for a stage emitter. 1) You can double-click on the emitter on the stage, 2) you can R-click the emitter in the hierarchy window and select Properties from the menu, 3) you can R-click on the emitter on the stage and select Properties from the menu, or 4) you can use the keyboard shortcut of ALT+ENTER.

Use any one of these methods to open the emitter properties dialog:

Don’t click on anything yet.

You should be familiar with many of the parts of the emitter properties dialog (props dialog for short). On the left side of the dialog is the hierarchy window. It is very similar to the main hierarchy window, but it only displays a single emitter. (When we are discussing the props dialog, you should assume that any references to the hierarchy window mean the one in the dialog. When we are not discussing the props dialog, you should assume that references to the hierarchy window mean the main hierarchy window – not the one in the props dialog. Sometimes we will specifically refer to the props dialog hierarchy window or the main hierarchy window for clarity.)

To the right of the hierarchy window are two tabbed pages: Properties and Particles. The Properties page is displayed when the emitter or the emitter properties are selected in the hierarchy window. The Particles page will be displayed when a particle type or a particle type property is selected in the hierarchy window. (We’ll come back to the Particles page.) The large empty white window is the graph window that works with the hierarchy window (just as the two windows work together when not in the props dialog) to display and edit the emitter properties that can change over time.

To the right of the tabbed pages is the preview window. It shows what the emitter or selected particle type looks like in action. It can be disabled using the “enabled” checkbox if too much is going on and the system is not responsive enough. The frame rate box can be used to see what the emitter will look like at different frame rates. The achieved frame rate is displayed above the preview window.

Below the preview window is some information about texture RAM usage in the project. This can be important when using hardware accelerated OpenGL, but we’ll cover this in a later tutorial when the OpenGL settings are discussed.

Okay, let’s click around a little. Select one of the emitter properties in the hierarchy view (don’t select the particle type or any of its properties yet) and you’ll see its data in the graph window. All graph windows work the same – adding, moving, deleting keys, zooming, scrolling – it’s the same in all graph windows. The only difference is that there is no current frame indicator in the props dialog graph window.

# Preview

The props dialog preview window works exactly like the main preview window, and since we haven’t talked about any preview windows yet, let’s see what the preview window can do.

Of course you already know that you can click and drag in the preview window. Did you know that you can drag an emitter so it is outside of the preview window? If you do this only the particles that make it back into the preview window area will be visible, but this feature can be useful.

If you R-click in the preview window you’ll get the following menu:

The Edges menu item turns the edges of the window into a boundary that particles will collide with. Use this to see what the particles will do when they hit a deflector (deflectors will be covered in a later tutorial).

Select the Zoom menu item to show a list of the available preview window zoom levels. If you have an emitter that is “too big” for the preview window, use this to zoom out and make the emitter appear to be farther away. Of course, you can also zoom in to get a magnified view of the emitter.

Something to keep in mind about zooming the preview view. Shaped emitters (line, ellipse) which we’ll discuss later may not appear correctly when the preview window is zoomed to anything but 100%. When zoomed out too few particles may be emitted, and when zoomed in too many may be emitted. This only applies to the preview windows – the particles displayed on the stage are always correct.

Okay, now let’s take a closer look at the emitter properties on the Properties page. In order to look at all of the properties, we’ll need to start with a slightly different emitter. Cancel the props dialog (by clicking the Cancel button in the lower right corner of the props dialog). Now R-click on the emitter on the stage.

Select the Add Point menu item. This will convert the emitter from a point emitter to a line emitter. The mouse cursor should have changed to a crosshair, and there is a small circle at the cursor position connected by a line to a small circle at the emitter’s position. Move the cursor a small distance from the original point and L-click. The emitter is now a line emitter, which means that particles will emit from all along its length instead of at a single point. That’s all we’ll say about line emitters for now.

Open the props dialog for the emitter again (remember there are several ways to do this) and select the emitter life property in the hierarchy window.

Because we selected a graphable emitter property (life) the Graph Information window displays a small reminder about what this property does.

The Shape choices show the three emitter shapes that are possible. Since the emitter we’re looking at now is on the stage, we can’t change the shape here – the emitter shape must be changed on the stage (as we did a few moments ago). The Shape choices are available when editing an emitter library, which will be covered in the next tutorial.

Before we look at the Emission options we’ll need to make a change to the Emission Range and Emission Angle properties otherwise changes to the Emission options will not be visible. Select the Emission Range in the hierarchy window and drag the data key to 0 (in the graph window). Select the Emission Angle and drag the data key to 90. The preview window should show something like this:

The particles are emitting directly away from the emitter, which is perpendicular to the emitter. That's due to the emission angle being 90 degrees. You’ll also see that the particles are all travelling parallel to each other, which is due to the emission range being 0.

Finally you can see that particles are emitting from the line emitter in both directions (from both sides of the line). That’s what the In and Out emission options do: control the side of the emitter that particles emit from. Since both the In and Out boxes are checked, particles emit from both sides. Uncheck the In box and you’ll see that particles emit from only one side. Now try to uncheck the Out box. You can’t do it, because at least one of the boxes must be checked. To uncheck Out you’ll first need to check In.

Okay, now make sure both boxes are checked and Now check the Emit at Points box. When this option is checked the particles will emit at discrete points along the emitter instead of anywhere along the emitter. The number box that appears determines the number of points used for emission.

Change the number of points to three and see how the emitter changes.

With the Emission options set as shown above, select the Emission Angle property in the hierarchy window, and drag the data key up and down. Notice how the emitter changes.

Note that the Emission options are only available when the emitter is a line or ellipse emitter, since a point does not have two sides, and by definition it is already emitting at a point. You may be wondering why the options are called “In” and “Out”? Those names make sense when used with an ellipse (or circular) emitter where there is an inside and outside to the emitter.

# What good is Tint?

Remember when we talked about the Tint Strength property in the last tutorial? It works together with the Tint Color to “colorize” an emitter.

You may think that tinting an emitter is something that you will very rarely use. Let’s do a quick example that may change your mind.

First, close the props dialog by clicking the Cancel button. Now start a NEW project. Select the Simple Explosion library emitter and add four blasts to the stage so they all start at frame 1.

Open the props dialog for the second emitter (we’ll leave the first emitter untinted) and change the tint color by clicking on the small color window and choosing the color from the color picker dialog that opens. Make the color bright red.

Close the props dialog by clicking the OK button (so the changes we just made are saved. Clicking Cancel would have discarded ALL changes we made in the props dialog.)

Now change the tint color of the third emitter to blue, and the tint color of the last emitter to green. Don’t forget to click OK to close the props dialog or your changes won’t be saved.

Now we’ll adjust the tint strengths of each emitter so the tint color actually does something. Make sure SHOW PARTICLES is on. Jump to frame 10 so the explosions are all in progress. Now select the tint strength property for the second emitter and start dragging its data key up. You can see the effect of the tint on the emitter – it is getting more of a reddish hue. Set the tint strength to about 40%. Select the tint strength of the third emitter and set it to about 40% as well. Do the same for the last emitter.

Now REWIND and PLAY. The first thing you’ve probably noticed is that you don’t always get the colors that you expected. The third emitter was supposed to look blue, but it got more of a white tint than blue. Why? Remember that the tint color does not replace the original particle colors – it is blended with them. Only when the tint strength is set relatively high does the blue really take over. It would probably have been easier to set the tint strength in the props dialog for each emitter so you could see how the tint affected the entire explosion.

The second thing you may have noticed is that too much tint is not always the best looking effect. In the case of explosions, you probably wouldn’t want to set the tint strength too high – lower settings give a subtle variation in color to each blast, which can help to add realism to an animation. Go back to each emitter and change the tint strength to about 20% and PLAY. Notice the subtle color variations between the explosions?

Of course, we’re not saying that you shouldn’t use high tint strengths, but when you’re going for realism subtle is usually better.

The last two options on the Properties page are Keep Particles in Order and Frames to Preload.

In all of the examples we’ve done to this point we’ve used emitters that started emitting particles from the frame the emitter was added to the stage. That is, we saw the emitter start with no particles and saw the first particles emerge. What if we wanted to create a scene in which we see a waterfall or a smoking fire? We need the emitter to be “fully emitting” the moment we see it. That’s exactly what the Frames to Preload (or just Preload) option does. The number entered in the box is the number of frames that you want the emitter to have been emitting before it activates.

Let’s do a simple example. Close the props dialog, start a NEW project, and add a Heavy Fire Particles emitter to the stage at frame 1. With SHOW PARTICLES on (you should really leave SHOW PARTICLES on most of the time, and only turn it off when drawing the particles is slowing things down too much) you should not see anything at frame 1.

Now open the props dialog for the emitter and set the Preload value to 60. This says that when the emitter first activates (at frame 1 in this case) it will look like it has been active for 60 frames already. Close the props dialog (using OK) and you should see the difference at frame 1 – there is now a trail of particles showing.

Before we look at the last option – Keep Particles in Order – we need to understand how Illusion draws particles. When a new particle is created by an emitter, the particle is added to a “list”. This list is used to when drawing the particles – drawing starts with the first particle in the list and ends with the last. At first this means that the oldest particles are drawn first, and the newest particles are drawn last. After some time, the life of some of the particles expires. In order to conserve memory, Illusion will reuse these “dead” particles and create new particles from them. The new particle remains in the same place in the drawing list though, which means that now some of the newest particles are being drawn before some of the older particles – the drawing list is no longer “in order”. As more time passes and more particles die, the drawing list gets more and more mixed up.

In most cases this mixing up of the drawing list makes absolutely no difference – the particles appear the same no matter what order they are drawn in. In some cases though, the order that the particles are drawn does make a difference. In these rare special cases, the Keep Particles in Order option can be checked. This does a few things. First, more memory will be used since dead particles will not be reused. Second, the particles will be drawn in a specific order – oldest first or newest first. What determines the order in which the particles are drawn?

The answer to this: the Zoom property. If the emitter zoom increases over time the particles will be drawn oldest first, newest last. Think about this for a minute. If the zoom is increasing, the emitter appears to be getting closer to the viewer. Therefore the newest particles need to “cover up” the older particles, so old particles need to be drawn first. If on the other hand the emitter zoom decreases over time, the particles will be drawn in reverse order – newest first, oldest last. Since the zoom is decreasing the emitter appears to be moving away from the viewer, so the oldest particles will be closest to the viewer and need to be drawn last.

Remember that you should only use the Keep Particles in Order option when necessary as it uses more memory. (For a relative indication of how much more memory this option uses, look at the right end of the status bar at the bottom of the Illusion window.

There is a number to the left of the frame rate display which you may have been wondering about. This is the number of particles that are currently allocated for the project. After checking the Keep Particles in Order option, you can see how much larger this number will get – it varies based on the emitter.)

# Jumping in to Particle Types!

We are finally ready to start looking at the real low-level stuff in Illusion – the particle type properties. Start a NEW project, add a Heavy Fire Sparkles emitter to the stage, and open its properties dialog.

Just select the Particles page before you do anything else (click the Particles tab). Notice that the particle type has been selected in the hierarchy window. When the emitter or one of its properties is selected in the hierarchy window, the Properties page is automatically displayed. When a particle type or one of the particle type properties is selected in the hierarchy window the Particles page is displayed. It works the other way too – selecting the Properties page will select the emitter in the hierarchy window, and selecting the Particles page will select the first particle type in the hierarchy.

The preview window may also change when you select a particle type since the preview window will show the entire emitter (all particle types) when the emitter is selected, but only the selected particle type when a particle type is selected. Since Heavy Fire Sparkles only has a single particle type you won’t notice this change.

Look at the Particles page now. At the bottom of the Behavior page there is graph window (for displaying the particle type property graphs) and a Graph Information window just as in the emitter Properties page.

We’ll cover the particle type properties (that display in the graph window) in a while.

At the far left you can see a small preview of the particle shape – what particles of this type will look like. You can use the Flip X and Flip Y options to flip the particle shape but in this case it won’t make a difference since the shape is symmetrical. More on particle shapes shortly when we cover the Change Shape page.

The Intense option is used to make particles appear bright. Uncheck this option and see the results in the preview window. One important thing to note about Intense particles – they are additive. Turn on the edges of the preview window (R-click the preview window and select Edges) to see this more clearly. Where the particles overlap, they add until they saturate. For this reason Intense particles look best when on a dark background; a black background is best.

The Preserve Color option can help to keep Intense particles from saturating this way, but its result is usually to make the particles less intense. In some cases you may find that the Preserve Color option does what you want it to, but if it does you should compare the results to what you get when the Intense option is unchecked. Many times Intense particles with Preserve Color checked look the same as if the Intense option were not checked at all. If results are the same, then uncheck Intense instead of checking Preserve Color, since drawing particles with Preserve Color checked will be slower.

If you check the Single Particle option you’ll see a single very small particle in the preview. This option is used to place a single copy of the particle at the emitter position. This can be used to do sprite animation (see the Mouse library emitter) or to add a glow to the emitter (as in the Shooting Star library emitter).

When the Single Particle option is checked, the particle type velocity, weight, and motion randomness properties no longer apply – the particle is fixed to the emitter position. Also, the life of the particle is now tied to the “life” of the emitter as determined by the emitter active property. If an emitter is active for 60 frames, the single particle will have a life of 60 frames. (If the emitter active graph has a single data key which means the emitter is active forever, the single particle defaults to a life of 1000 frames. You may notice that if you just watch the preview window for a while, the single particle will eventually disappear. It has reached the end of its default 1000-frame life. Just click the preview window to recreate the particle.)

The Attached to Emitter option is used to connect the particles to the emitter so when the emitter moves the particles move with it. Before checking this option, drag the emitter around in the preview window. Now check the Attached to Emitter box. A slider becomes visible to the right, but ignore it for a second and drag the emitter around the preview window. The particles should now move with the emitter.

The slider is used to control how attached to the emitter the particles are. When the slider is far right (the default) the particles are 100% attached; moving the slider to the far left makes them only 10% attached. Usually you will leave the slider at the far right. The Apply to All checkbox is used to apply the current attachment settings to all of the particle types of the emitter – very handy when the emitter has several particle types.

Why would we ever want to attach the particles to the emitter? Suppose we had a scene of a waterfall and we want the “camera” (our viewpoint) to move across the scene. The waterfall would need to start at one side of the scene and move across to the other side of the scene (the waterfall would not actually be moving, but it would appear to, along with everything else in the scene). If we just moved the emitter across the stage the emitter would leave a trail of particles, and we would not get the effect we wanted. If the Attach to Emitter option was used, the particles would not trail but would move with the emitter, giving us the effect we wanted.

Note that when particles are flagged as Attached to Emitter, changes in the emitter angle property (in the hierarchy window) will affect the particles as well, although if the particles have weight (so they fall or rise) the results may not be consistent.

# Particle Type Behavior

Now we’ll begin our look at the Behavior page of the Particles page.

The Particle Angle option determines the initial angle of the particles of this type (the angle that the particles are drawn at when they are created).

When the Specify option is selected all particles will have the same initial angle which is indicated in the entry box to the right. The Random option gives each particle a random starting angle, which is often useful to provide more realism in effects such as smoke. The Align to Motion option when selected sets the initial angle of each particle to the angle at which it is emitted.

When selected an entry box and a Keep Aligned to Motion checkbox appear. The entry box is used to provide an angle offset so the particle can be rotated an additional amount (90 degrees for example). The Keep Aligned to Motion option does just what it says – it keeps the particle aligned to the direction it is moving throughout its life.

Note: if we use the Single Particle option with the Keep Aligned to Motion option, the single particle will align itself to its motion path.

Now let’s take the plunge and look at the graphable particle type properties in the hierarchy window. If you don’t have the Heavy Fire Sparkles emitter on the stage, put it there and open its props dialog. Expand the particle type (“fiery”) in the props dialog hierarchy window. Wow – look at all of those properties!

You’ll notice that some of the properties have the same names (and the same icon colors) as some emitter properties. Remember that those emitter properties were scale factors that were applied to particle type properties – here are the particle type properties.

Select the life property, and look at the graph window. The frame numbers still appear along the x-axis (bottom), but now instead of percentage values along the y-axis as with the graph of the emitter properties, there is only a relative scale from Min to Max.

Particle type properties do not have numeric values or units. Use the preview window to see the effects of changes you are making. (In most cases the Min value corresponds to 0, but the Max value has no meaningful numeric equivalent.)

We’ll discuss each of the properties now. In the descriptions that follow, note that the values of each property are applied at the time that the particle is created – they do not have anything to do with how the particle behaves over time. (The only properties that determine how the particles behave over time are the “over life” properties which will be covered shortly.)

Life is the length of time that the particle is “alive”. Note that that a particle can be alive but not visible (we’ll talk about particle visibility later). Higher values mean the particles live longer.

Number controls how many particles are created. Higher values mean more particles are created.

Size determines how big the particles appear.

Velocity controls how fast the particles move away from the emitter.

Weight is different than the previous properties because its graph does not go from Min to Max – it goes from –Max (negative) to 0 to +Max (positive). A particle with zero weight is weightless. A particle with a positive weight falls (moves toward the bottom of the screen) and a particle with a negative weight rises (moves toward the top of the screen).

Spin is also different from the other properties – its graph has positive and negative values too. A positive spin value means that the particle will rotate clockwise. A negative spin means a counter-clockwise rotation. A value of zero means no spin.

Motion Randomness determines how randomly a particle will move. Note that this property will seem to “override” the velocity and weight settings; the random motion may cause particles to reverse direction.

Bounce only applies when a particle hits a deflector (discussed in a later tutorial). Higher values mean more bounce. Note that when a particle has a Min (zero) bounce value may be able to pass through a deflector. For instance if a particle has a positive weight (so it falls) and a zero bounce and comes to rest on a deflector, it may eventually sink through the deflector. A very small bounce value will help to prevent this.

Visibility determines the transparency of the particles. Note that the value (y-axis) scale of this graph is 0-100%. A value of 0% means invisible, and 100% means completely opaque. Some particle types look best 100% visible (thick smoke for example) but some look best with some transparency. Note that there is an additional transparency control for the particle type in the Colors page which we’ll discuss soon.

Remember that all of the particle type properties that we listed above have corresponding emitter properties that are additional scaling factors. What this means is even though a particle type property is set to Max, the resulting particle property can still be a very small value or even zero depending on the emitter property value. For example, if the particle type size property is set to Max and the emitter size property is set to 10%, the final particle size will be very small.

The properties above are applied to every particle of this type that is created. What if we want some variety in a property? For instance, what if we want the particles created to vary in size? The next group of particle type properties are used to do just that – provide some variety or variation. Since each variation property works the same but on a different base property (life, number, size, etc.) we won’t list each of them. Just realize that a Min setting of a variation property means that there will be no variation in the property, which means that every particle created has exactly the same value for the given property. Higher values of variation result in particles that have a wider variety of values for the given property.

For example, if the size variation property is set to Min (0), all particles of this type that are created will have the same size (which is determined by the size property). If the size variation is set to a higher value some particles will be created larger than others. The basic size of the particles is still determined by the size property.

Note that the two properties that have both negative and positive values – weight and spin – have variation properties (weight variation and spin variation) that may not produce the results you expect. Suppose we want the particles to spin in both directions (clockwise and counter-clockwise). We might think that first we’d set the spin property so the particles have some spin, then set the spin variation to some non-Min value. If we did that we’d see that most (if not all) of the particles spin in one direction, depending on what values we set for each property. To make an equal (approximately) number of particles spin in each direction, we need to leave the spin value at zero, and only use a spin variation value.

(Before we move on, something to note that may not be obvious. Suppose we want particles that move very fast. We’ve already set the velocity property to Max, but it’s not fast enough – we need it faster. That’s where we use the emitter velocity property to increase the particle type velocity. With the emitter velocity graph we can scale the particle velocity by 2000%!)

A quick review. We’ve seen the basic particle type properties (life, size, velocity, etc.), and we’ve seen how to vary these basic properties for different particles using the “variation” versions of these basic properties. So far, these properties only determine the values for the particle at the time the particle is created. Now we’ll discuss how to change the base properties over the life of a particle.

Most of the basic properties have “over life” equivalents just as they had “variation” equivalents. Size over life, velocity over life, motion randomness over life, and bounce over life all work the same, so we’ll use size over life as an example. Select size over life in the hierarchy window and notice how the graph window changes (it will look like this if you’re still using the Heavy Fire Sparkles emitter):

The x-axis represents the particle’s life It doesn’t matter how long the life is, the left end (0.0) represents the start of the particle’s life, and the right end (1.0) represents the end of its life.

The values along the y-axis are percentage values, since the “over life” values are scale factors that are applied to the basic property – size in this case. If the graph were a horizontal line at 100%, the particle would be the same size its whole life. If the horizontal line were at 60%, the particle would still be the same size its entire life, but it would be smaller. In the example here, the particle starts pretty small (20%) then increases in size until it reaches 200% at about 7/10th of the way through its life, then it decreases down to a size of 0 at the end of its life.

(The other properties: velocity over life, motion randomness over life, and bounce over life work the same as size over life.)

Data keys are added, moved, deleted in the “over life” graphs the same way they are in the other graphs. The difference is that the data keys at each end of the life (0.0 and 1.0) can’t be moved horizontally, and can’t be deleted.

The weight over life and spin over life properties are again a little different because weight and spin have both negative and positive values. This is the weight over life graph for the Heavy Fire Sparkles emitter particle type:

You can see that the possible values range from –100% to 100%. The weight in this example is not changing over life though – it’s just at the default of 100% for the entire life.

Grab the data key at 0.0 and drag it down to about –60%. What this does is make the particles “light” (so they float) at first, and they get heavier as they get older. You can see this occur in the preview window.

Note that a negative value in the weight over life graph “reverses” the basic weight value. Since the basic weight value was positive (so the particle fell), setting the initial data key in the weight over life graph to a negative value made the particle rise initially. If the basic weight value were negative (so the particle rose instead), then the negative initial data key in the weight over life graph would have made the particle fall instead. Remember that the “over life” values are scale factors.

One last point to make about the weight and spin over life values. Since they are scale factors, they need to scale something. If the weight value (the weight property in the hierarchy window) is zero, the weight over life values will do nothing. Similarly if the spin value is zero, the spin over life values will have no effect.

Now we’ve covered all of the particle type properties that are found in the hierarchy window. That also finishes our discussion of the Behavior page – we can now move on to particle shapes.

#

# Particle Shapes

Using the same Heavy Fire Sparkles emitter we’ve been using all along, select the Change Shape page.

The two main elements of this page are the shape list which displays all of the textures in the current emitter library, and the large shape window (called “large” so it isn’t confused with the small shape window that we’ve seen at the top of the particles page).

A particle shape in Illusion is simply an image (or images). Select different shapes from the list and you’ll see each shape image in the shape window. You’ll also notice the Make Active button appears. Pressing this button will apply the displayed shape to the particle type, and the results will be immediately visible in the preview window. Try it now – select any of the shapes you want and make them active. (The original shape used in this particle type of the Heavy Fire Sparkles emitter is “blurred star”.)

You’ve probably noticed that some of the shapes in the list have different icons. There are four types of shapes in Illusion: grayscale, full-color, grayscale multi-frame, and full-color multi-frame. The shapes that have a gray icon (a gradient from white to black) are grayscale shapes. The rainbow-colored icons indicate full-color shapes. Icons with the series of small arrows are the multi-frame (animated) shapes. More on the differences between grayscale and full-color shapes in a minute.

There are a few buttons visible below the shape list. These first buttons allow you to add a new folder or delete a folder if there is more than one in the library. (Note that shape folders do not really have much use since they are used to organize the shapes, but it is not possible to move shapes between folders in this version of Illusion. They will be more useful in future versions.) The delete folder button will most likely not be visible, as it is only displayed when there is more than one shape folder and a folder is selected.

The next two buttons are used to add a new shape to the library or delete a shape from the library. (The delete shape button will only be visible when a shape is selected in the list, and there is more than one shape in the folder.)

The most important button is Add New Shape to Library. All of the shapes that are currently in the library are there because they are being used by at least one particle type of at least one library emitter. It is also possible to add shapes to the library that are not used by any particle types of the library emitters. Why would we want to do that? Well it definitely is not a good idea to add a shape to the library just for the sake of adding it. The library should contain shapes that we intend to use, otherwise we’re just wasting memory. If we do plan on using the shape at some time though (for instance we have a shape looks like it might work well for smoke) we should add it to the library. We do it using the Add New Shape to Library button (“Add Shape” for short).

Click the Add Shape button. You’ll see a standard Windows File Open dialog. Now select an image that you think would make a good particle shape. Any image will work (as long as it is in one of the file formats supported by Illusion). Select any image now (not an AVI – we’ll get to that in a minute) and you will see the particle shape type dialog:

Here you must choose which type of shape you want the image converted to. The grayscale type is fine for most cases, and is the recommended format because it uses less memory. (Don’t let the term “grayscale” lead you to think that all particles that use this shape will be gray. Particles that use a grayscale shape can be as colorful as you want – the colors are set on the Colors page which we’ll discuss soon.)

The full-color option should be used if: 1) You want the colors of the image to be preserved in the shape or 2) The image has alpha channel information that you want to preserve. (Note that particles that use full-color shapes can still have their color changed – the colors designated on the Colors page will be blended with the shape colors.)

If you selected an image that is part of an image sequence (or appears to be because the filename ends in a number, for example mouse001.tga), Illusion will next display a dialog similar to this:

The number of images that appear to be in the sequence is displayed.

If you answer No, only the single image will be used – the shape will have a single frame.

If you answer Yes, you will see the following dialog, which is also the dialog that is displayed when an AVI file is selected instead of an image file:

Multi-frame shapes use much more memory than single frame shapes. This dialog allows you to see just how much memory the shape will use and allows you to skip frames to decrease that amount of memory.

#

# Memory Considerations

Most graphics applications tend to use large amounts of memory (RAM). Illusion can require a lot of memory as well, but there are special considerations when you are using Illusion in hardware accelerated OpenGL mode (HW OpenGL). Because the amount of memory that is available on 3D video cards is not unlimited, the number of particle shapes that you can use without experiencing problems is not unlimited either.

Typically, your 3D video card will have a specific amount of its memory set aside for OpenGL texture RAM. (This amount of RAM may be user-configurable via a control panel applet, or using a utility supplied with your video card. This is different for each 3D card.) The total memory used by the shapes in the library is displayed next to the shape list:

If this total memory is greater than the amount of OpenGL texture RAM that is present or allocated on your video card you may start to experience problems. Things may start to slow down, or you may see some particles as colored squares instead of the shapes that they should be. Note that we’re not saying that you will have problems, but by keeping the total memory used by the shapes smaller, you should avoid these problems.

Ok, back to the shape that we are adding to the library. If we chose to create a full-color shape and the source image contains alpha channel information, the alpha channel will be used to provide the transparency for the shape. If the image did not contain alpha channel information, we will see the following message:

The color of the first pixel in the image (upper left corner of the image) is used as the transparent color for the shape. All pixels in the shape that are of the exact same color will be transparent in the particle shape.

If we chose to create a grayscale shape instead of a full-color one, the source image will be converted to grayscale. In this format, transparency of the shape is based on the level of gray – black pixels are completely transparent, and white pixels are completely opaque.

Regardless of which type of shape we choose to create, the image will be resized to 128 x 128. For this reason it is best to use an image that is square already, or the resulting shape will be distorted. Illusion does a pretty good job of preserving the image quality when resizing, but using a source image that is 128 x 128 will guarantee that the shape looks exactly as we intended.

(Note that the large shape window displays the shape full-size – 128 x 128 – so you can see if the image has been distorted.)

The new shape has been added to the library, and you should now name the shape something appropriate. If you want to apply this shape, use the Make Active button.

If you created a multi-frame shape (using an image sequence or AVI) there will be a few additional controls displayed under the large shape window:

The small left and right arrow buttons are used to display each frame of the shape. The current frame number and the total number of frames are displayed as well. We can see that the “mouse” shape has a total of ten frames. (We can also see that the mouse shape uses almost a full MB of RAM, which illustrates that multi-frame shapes can eat memory pretty quickly, especially when they are full-color!)

As long as it’s being displayed, let’s talk about the regular-sized button that is under the large shape window. It looks exactly the same as the Add New Shape to Library button. If we position the mouse cursor over it, we can see that it is the New Shape button. The New Shape button works exactly like the Add Shape to Lib button, except that as a final step the shape will not be added to the library, but will automatically be the shape for this particle type. (It is not necessary to use the Make Active button.) The New Shape button is perfect for the times when you know that you will not use this shape again – it will be used in the current emitter and nowhere else.

A few more things to mention about the Change Shape page. First, if there are any shapes in the library that are not being used in the library (by at least one particle type of at least one library emitter), a message will be shown when that shape is selected.

Periodically you should go through the library and see if there are any shapes that are not being used. If so, you may want to consider deleting those unused shapes from the library, especially if the shape is multi-frame. Doing so will conserve memory.

You delete shapes from the library using the Delete Shape from Library button. Select the shape in the list and click the Delete Shape button. If the shape is not being used in the library we will see a dialog asking us to confirm the deletion. (Note that the message in the dialog states “there is no undo of this action”.) If the shape is being used in the library, we will see how many particle types in the library will be affected.

At this point we’ll most likely want to answer No so the shape will not be deleted, because we probably do not want to change any particle types in the library.

If we said Yes at this point, the shape would be deleted, and any particle types that used this shape would now use a different shape. Earlier we mentioned that the Delete Folder button would be visible if the list contained more than one folder. Note that if you do choose to delete a folder, all of the shapes in it will be deleted too, which will most likely display the above warning dialog that particle types will be changed by the deletion.

# Color

The last particle type property that we need to look at is color. We want to keep using the Heavy Fire Sparkles emitter as our example. Select the Colors page.

The top half of the dialog we’re familiar with already – it’s the Illusion color picker dialog that we saw when talking about Tint Color.

The bottom half is the interesting part. The top gradient represents the color of the particle throughout its life. Each point that is defined by a color is designated with a small rectangle – we’ll refer to these as “color points”. The color point that is selected is shown with a double rectangle, and its color is shown in the color preview. Any changes made in the color picker windows change the color of the selected color point.

The left end of the gradient window represents the start of the particle’s life (the instant it’s created), and the last color point in the gradient represents the end of the particle’s life. In the example shown above, the particle starts red, changes to orange/yellow at a little past the halfway point in its life, then changes back to red at the end of its life. Note that the black area to the right of the last color point does not mean that the particle turns black.

Color points are selected by clicking on them, and can be dragged left and right. Clicking on the gradient but not on an existing color point creates a new color point the same color as the previous color point. When a color point other than the first one is selected, the Delete Color Point button becomes visible:

When the Delete button is clicked, you will be asked to confirm the deletion. It is not possible to delete the first color point.

Let’s do an example. Delete the last two color points. When only a single color point exists, the color fills the entire gradient window because the particle will be that color its entire life.

Now click toward the middle of the gradient to add a second color point, then use the color picker windows to make the second color point a light shade of blue.

If you look at the preview window, you’ll see that the particles are blending to white in some places – let’s make the particles non-intense for a minute so we can more clearly see the colors we’re setting. Do this by unchecking the Intense checkbox at the top of the Particles page.

What you’ll notice now is that the particles (in the preview window) are starting red, fading to blue, but then getting red again. Why? The answer is the Repeat slider under the color gradient. Move the Repeat slider to the far left. Now the particles appear as expected. The repeat slider is used to repeat the color gradient one or more times over the life of the particle. Let’s move the slider one “click” to the right. The result is that the particles start red, fade to blue, then jump to red and fade to blue again.

(If you want the colors to repeat smoothly, make sure that the color at the right end of the gradient is the same as the color at the left end of the gradient.)

One use for the repeat slider is to make particles sparkle. Check the Intense option again, then change the color gradient so it fades to black instead of blue. We’ll also set the repeat slider to about five repeats (the repeat slider has a range of 0 – 10).

We can see in the preview window that the particles are now “sparkling”. (Note that if too many of the particles seem to blink on and off all at the same time, set the life variation property to a higher value).

Okay, turn off repeat (slider far left). Add a few more color points between the first and last, but leave the last one black.

Now check the “choose random color…” option. This does exactly what it says – it chooses a random color from the gradient and does not cycle through the gradient. The particle remains the same color its entire life, but each particle will be a different color. (The “Autumn Leaves” library emitter uses this option.)

You may have noticed that the lower gradient has been changing as we changed the color gradient.

This gradient represents the transparency (or visibility) of the particle over its life.

It behaves just as the color gradient – click and drag, click to add color points, etc. except that the colors in it are grayscale only. Black represents completely transparent, and white represents completely opaque.

The reason it has been changing automatically (and the reason we can’t make any changes to it directly) is that the Link Transparency to Color option is checked. With this checked, the transparency gradient is a grayscale version of the color gradient. This means that dark particles are more transparent, and brighter particles more visible. This works fine for many types of particles, but will not work if we want to make some dark particles that are visible – black smoke for example.

In order to do this, we need to uncheck the Link Transparency to Color box. Once we do this, we can now modify the transparency gradient (add points, move them, delete them, set a repeat value). Note that when the Link box is unchecked, two choices appear above the color gradient:

Since both gradients can be changed now, changes to the color picker windows can be applied to either gradient. These new choices designate which gradient is being modified. When you click on the color gradient itself, the Color button is automatically selected. Similarly, when you click on the transparency gradient, the Transparency button selects automatically. You can also click the buttons themselves to select the gradient you want to modify.

Believe it or not, we’ve now covered everything there is to know about emitter and particle type properties! We’ll take a look at a last few things in the props dialog, then this tutorial will be finished.

# New Particle Types

So we now know how to modify existing particle types. What if we want to create a new particle type in an emitter, or delete a particle type from an emitter? For that we need to look back at the props dialog hierarchy window – below it actually.

This is the New Particle Type button. It is used to add a new (default) particle type to an emitter, or to make a copy of an existing particle type. If a particle type is currently selected in the hierarchy window, clicking this button will make a copy of the particle type and add it to the emitter. The new particle type will be named “Copy of …” to designate that it is a copy. If a particle type is not selected when the button is clicked, a default particle type will be created. It will have no color, use the first particle shape in the library, and just have some basic property settings.

Once an emitter has more than one particle type in it, the Delete Particle Type button becomes visible when a particle type is selected in the hierarchy window.

When the Delete Particle Type button is clicked, a dialog appears asking for confirmation of the deletion. Note that it is not possible to have an emitter with no particle types, so the Delete button is not available when only one particle type exists.

You may remember back in Tutorial #2 when we had multiple emitters on the stage and wanted to change the order in which they were drawn. The top emitters in the hierarchy window were drawn last, right? Well a similar thing applies to particle types of an emitter – particles of the type at the top of the hierarchy are added last. (Note that this doesn’t mean that the particles will be drawn last, since drawing order of particles changes – see the discussion of “keep particles in order”.) The order the particle types in the hierarchy is usually not important, but sometimes it does make a difference.

To change the order of particle types in the hierarchy, R-click on the particle type:

The Move Up and Move Down menu items will do just that – move the particle type up or down in the hierarchy.

(Remember that you won’t see the change in the preview window until you select the emitter in the hierarchy window, since when a particle type is selected only that particle type is previewed.)

# More Memory Considerations…

Earlier we talked about particle shapes and how the amount of memory that a library uses can be important when dealing with OpenGL hardware. There is something else that must be taken into consideration: the amount of OpenGL texture RAM that the project itself uses (as opposed to what the library uses).

Below the preview window in the emitter properties dialog is a display of the texture RAM that the project is using:

The memory required for all of the particle shapes used in the project is listed, as well as the memory that any background images require. (Background images will be discussed in another tutorial.)

The important line is the Total. If this value is greater than the amount of OpenGL texture RAM that is present or allocated on your video card you may start to experience problems (see the “memory considerations” section above).

The last thing that we need to look at in the properties dialog is the Add to Library button. This button will add a copy of the emitter in its current state to the emitter library. Note that if the library contains more than one folder, the emitter will be added to the folder that is currently selected. (It is also possible to add an emitter directly from the stage to the library without opening the props dialog. This will be covered in a later tutorial.)

That wraps up this tutorial. Yes, it covered a lot of material. The best way to get comfortable with all of the emitter and particle type properties is to play with them. Another great way to learn about what each of these properties can do is to examine the library emitters. We could add one of each of the library emitters to the stage then open the props dialog for each of them in turn, but there is an easier way, as we’ll see in the next tutorial.