You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Torque 3D provides a full featured
particle system
with many parameters which can be
manipulated to fine tune your particle effects. Particle effects are things such as
fire balls, smoke, and water splashes that you create and place into your levels.
The Torque 3D Particle Editor is the tool of choice
for full control over the look and feel of your effects. At its most
basic level a particle effect consists of: an emitter, a particle to be emitted from the
emitter, and an image rendered to represent that particle.
The emitter controls: the creation of the particles; their movement;
which directions the particles will travel, also referred to as the
spread pattern and: how each particle blends into the world.
The particle controls its own life span, what image will be shown; how big
the image is; what it's color over time is; and some basic force
settings.
Setup
From the Toolbox, create a new project using the Full template then load the Empty Terrain level.
If you have your own particle images that you want to experiment with, you will need
to copy them into the project folder at:
projectName\game\art\shapes\particles
Hint: It can be very helpful when creating particle effects to put
your camera into Orbit mode, so that it will be easy to orbit around the
selected emitter.
To place the camera into Orbit mode, from the main menu select Camera -> World Camera -> Orbit Camera:
Interface
The Particle Editor can be activated from the dmain menu by selecting.
Editors -> Particle Editor
Or alternately, click the Particle Icon
from the Tool Selector bar.
Whenever the Particle Editor is active the Particle Editor –
mitters pane will be present on the right side of the screen.
This pane is further divided into two tabs: (1) the Emitter tab
contains properties about the currently selected emitter; (2) the
Particles tab contains properties about the currently selected particle.
Select either the Emitter tab or
particle tab depending upon which object you wish to work with.
In edition to the tabs there are also two buttons within the header of the Particle Editor – Emissions pane:
One Shot Effect Types
There are two types of particle effect: (1) continuous effects, which constantly emit particles and; (2)
one-shot effects, which only produce particles for a short time and then stop. Continuous effects run
constantly so your changes can be seen in real-time as you adjust the properties of the emitter and
its particles. In order to see your changes for one-shot emitters you need to replay the emission.
To replay a one-shot emitter click the arrow icon to the right of the tabs.
The Temporary Emitter
When you open the Particle Editor you may have noticed it creates a
temporary particle emitter in your current view. This temporary emitter is very useful for quickly trying out different
particle editor settings.If your view is changed and you no longer see temporary emitter, press
the little camera icon to the right of the tabs to place it back into view.
It will always be placed in the center of your current view.
The temporary particle emitter can be moved, rotated, and scaled like any other shape using the
Object Editor.
New Emitter / Particle
To create a new blank emitter or particle that is ready to be configured, press the new icon
on the Emitter or Particle tab as appropriate.
Save Emitter / Particle
After editing an emitter or particle save the new
settings by pressing the save icon on the Emitter or Particle tab as appropriate:
Particle emitters are updated in real-time. Any changes to a particle or emitter will be
reflected through out your level when changes are saved. Any instances of the emitter or particle that you are editing will also be
changed.
As with a lot of Torque 3D Editors the Particle Editor writes the resulting data to
script files which the engine runs to create the particle emitter when you game is being played.
The Emitter tab contains the properties that define an Emitter. Properties are grouped into sections:
Basic
Basic properties affect the base emitter:
Life: The time duration in ms that the effect will emit particles.
Life (Random): Substitutes a random value for the life property.
Infinite Loop: When enabled this emitter will continuously
produce particles. This setting effectively causes the Life and Random Life properties to have no affect on the emitter.
Amount: The time in ms between each individual particle released
from the emitter.
Amount Random: Random Variation amount to be applied to
the amount setting.
Motion:
These settings will affect the emitter spread pattern, speed, and
particle image orientation:
Speed: The velocity the particle will leave the emitter in the
defined spread pattern.
Speed Random: A random setting for varying the speed.
Orient to Movement Direction: Enabling this option
fixes the particles image to the velocity direction of the particle.
Note this will over ride any particle spin settings.
Align to a Direction: Enabling this option aligns the particles to a predefined vector
set up in Align Direction option.
Align Direction: The vector used for particle alignment if the Align to a Direction option is checked.
Spread
These setting affect how the spread pattern will be dispersed:
Angle Min: The minimum angle for the emitter spread pattern.
Angle Max: The maximum angle for the emitter spread pattern.
(click to enlarge)
(click to enlarge)
Depth: The depth of the released pattern. A setting
of 360 will create a spherical spread pattern when Angle Max
is set to 360.
Offset: The distance from the emitter that particles will be released. Effectively the distance that the particle will be visible to the viewer.
(click to enlarge)
Particles
This affect assigns which particle(s) will be emitted from this emitter:
Particle 1 - 4: Select the particle from the drop down list to be used with this emitter.
If at any time you need to remove a particle
press the clear icon. Particle 1 can not be removed.
Blending
These setting affect how the particle(s) are rendered
Blend Type: The types of blending available to be applied to the particles.
Softness Distance: The particle edge blending distance.
Removes the hard edges where the particle meets an object.
(click to enlarge)
Ambient Factor: Adjusts the alpha blend (level of the particles which affects how transparent they are).
Sort Particles: The order in which particles are rendered.
Reverse Order: When enabled, reverses the render order set in the Sort Particles setting
Particle Properties
The Particle tab contains the properties that define a Particle. Properties are grouped into sections:
Basic
Particle basic settings
Texture Map: The image that will be used on the emitted particle.
The Edit button will open a file browser to locate and select a particle image.
Inverse Alpha: Invert the alpha channel on the partice image (if one exists).
Life: The time in ms (milliseconds) after its creation that the particle will exist for.
Life Random: Random variation to the particle life span.
Motion
These settings affect the velocity of the particle:
Initial Speed: The initial velocity, that the particle
will travel at after being emitted. (Not to be confused
with emitter spread speed.)
Acceleration: The rate at which the particle's velocity
with increase or decrease. Positive values cause a particle to speed
up over time after being emitted. Negative values cause a particle
to slow down over time after being emitted.
Gravity: The gravitational force to be applied to particle.
Positive values cause the particle to fall to the ground. Negative values
cause the particle to rise from the ground.
Drag: The amount of force working against the particle velocity.
Drag will slow a particle's movement.
Spin
These settings affect if, and how, a particle rotates in degrees:
Spin Min: The minimum rotation to be applied to the particle.
Spin Max: The maximum rotation to be applied to the
particle.
Spin Speed: The speed of particle's rotation.
Overtime
These settings affect the particle based upon how long it has been in existence for:
Each particle can have up to four color and size settings, which can be
set to change over time.
Colors: Four color swatches indicate the color phases which a particle can pass through.
To set any color click that swatch. The Color Picker Dialog will appear:
To set a color value you may: enter R (red), G (green), and B (blue) color values;
click anywhere within the gradient on the left or; click anywhere in the vertical
"rainbow" strip. Red, green and blue color values range from 0 to 255 and indicate
the amount of that color present in the overall particle color.
The alpha value which represents the transparency of the particle color can be set
by entering a decimal number between 0.0 and 1.0 in the Alpha field or by moving the
slider with the mouse. The higher the number the less transparent the color will be.
Size 1-4: Each slider sets the size for the particle during each time stage.
Time 1-4: Each slider sets the time for that stage.
Emitter and Particle Example Settings
The best way to get an understanding of the particle system is to experiment with the settings.
The following examples use the images below. Right click on each of the images and save
them to you project's particle folder at:
projectName\game\art\shapes\particles
Save this image as fire.png:
Save this image as spark.png:
Fire Effect - Looping
In this example we will create a fire effect with a
flickering rising motion.
This is an example of a looping effect which continuously emits particles as long
as the emitter exists. Changes to the emitter's properties are reflected in real-time.
First we will create a new particle. Select the Particle tab; press the
New Particle icon; rename this new particle to fire2Particle;
press the Enter key; and then click the Save button.
Your new particle will be saved. NOTE: You MUST press the Enter key after renaming
the particle BEFORE clicking the save button or the particle will not be properly saved.
After saving the particle you should now see that gray stars have been added to the golden
stars coming from the temporary emitter. This is a preview of your new particle. In the Basic
section of the Particle tab take note of the thumbnail picture to the left of the Texture Map
label. The emitter is now generating gray stars because that is the default texture assigned
to a new particle.
Click the Edit button within the Basic section of the Particle tab
A File Browser will appear. Navigate to the location where you saved the above images;
click the fire.png to select it; then click the Open button. You should now see your new
fire particle being emitted from the
temporary emitter. Save your new particle again so
that it will retain the new texture selection.
You will also notice that the other particles, the golden star and the gray star,
are still being emitted as well. Remember that you are seeing a temporary emitter
intended to show the changes that you make in real-time. In order to see the emitter
as you wish it to appear in your level you must load that specific emitter and assign
your new particle to it. Until you do this, you are seeing only a preview of the changes
you are making while creating new particles.
Any new particles that you create will not be available to the Particle Editor until
they have been reloaded. Exit the World Editor then restart it by reloading your
project's level from the Toolbox.
The Particle Editor should automatically be reactivated. Ensure the Emitter tab is
selected then click the New Emitter icon.
The emitter in the scene should be emitting golden "stars". This is because a new
emitter has been created which, by default, emits the defaultParticle which is a
golden star. Rename the new emitter to fire2; press the Enter key; and then click
the Save button, which is represented by the floppy disk icon.
Your new emitter will be saved. NOTE: You MUST press the Enter key after renaming
the emitter BEFORE clicking the save button or the emitter will not be properly saved.
Now let's tell the emitter to use your new particle. In the Particles section of the Emitters tab,
select your new particle by name from the Particle 1 drop down list.
If you do not see your new emitter in the list then go back and review the note which
speaks of the requirement to press the Enter key before saving a particle.
Most likely, you missed that step.
After making the selection you should see the emitter in the scene generating only your new
fire particle, and no stars at all. Next change the settings in your emitter
Properties pane to match the following images:
(click to enlarge)
Move the camera back if necessary to view the entire emitter. It should now resemble a flickering rising fire.
You could add an emitter for smoke and another for the embers to complete the fire effect.
Plasma Spark Effect - One Shot Example
This is an example of a one-shot effect which only emits particles for its
configured period of time. You will need to use the re-trigger button to view
this effect each time you make changes.
This effect will use the emitter non looping function to give a single
trigger effect. You will need to use the re-trigger
button to view this effect.
This example will use the image spark.png from the download above.
To create this effect follow the previous fire example exactly, with the
following changes: use the spark.png for the particle instead of fire.png;
name the particle sparkParticle; name the emitter sparkEmitter; and use the
properties below for the emitter and the partcle respectively:
(click to enlarge)
If you have modified the settings correctly, you should see an
interesting colorful particle pattern explode from the emitter each time you press the retrigger button.
Conclusion
This article covered the Torque 3D particle system and its many properties.
You should now have a basic understanding
of Emitters, Particles, and their parameters. By experimenting
with the settings and trying different particle
images, you will gain valuable knowledge ready for use in your own
future projects. You will soon be creating your own
special effects from water drops to rocket trails with Torque 3D's Particle
Effects Editor.