Documentation/Articles/Overview of Particle System Editor
From NeoAxis Engine Wiki
| Language: | Status: | Approved |
Contents |
Overview
It is often necessary to create special effects in computer games, such as smoke, rain, leaf fall, snow, fire, explosion or water stream. In order to create such effects particle systems are used.
Particle System Editor is a part of Resource Editor, designed for particle system creation.
In order to work with particle systems you have to know the meaning of the following terms:
- Particle refers to a separate particle of the system.
- Emitter refers to the particle source.
- Affector is used for current particle management, enabling the change of such parameters as color, rotation, scaling etc.
Accomplished effects are stored in the Data\Effects folder. There you can find the examples of fire, smoke and explosion effects.
Editor Adjustment
In order to adjust Particle System Editor press the Options button and chose the Particle System Editor option from the list. You can adjust the following parameters:
| Name | Description |
|---|---|
| Background Color | Choose the background color for the editor. |
| Show Axes | Displays coordinate axes for improved navigation. |
| Show Grid | Displays grid. |
| Sky Box | Specifies a skybox to be displayed at the background while editing objects. |
Tutorial: Creation of a Particle System
In this tutorial you will learn how create particle systems. As an example, you will create a particle system, implementing fire effect.
Creation of a New Particle System File
First of all, you have to create a folder for your new effect. To do this, right-click the Effects' folder and choose the New Directory option in the menu.
After specifying the folder name (e.g. ParticleSystemExample) double-click on it and press the New Resource button.
In the window that will pop up, choose the Particle System option from the list and press the Continue button.
Now, specify the name for the new particle system (e.g. ParticleSystemExample) and press the Next button.
Congratulations, you have created a new particle system file. Now you can proceed to particle system adjustment.
Particle System Adjustment
Each particle of a system is painted using a material. In order to create your effect you will need a material with a fire texture. Materials are usually created in Material Editor.
In this tutorial you will be using a ready material stored in the Data\Effects\FireParticle folder. Now, copy the files FireParticle.highMaterial and fire.png into the folder you have created before and rename them.
Now, proceed directly to particle system adjustment. To move to the editing mode, double-click on the file you have created.
First, specify a material for you particle system. To do this, select the MaterialName field and press the "..." button.
Now, choose the FireParticle.highMaterial file in your new effect's folder.
The material has been set, therefore, all particles will be painted with it. Now, you have to adjust a particle Emitter and a paticle Affector.
Emitter Adjustment
Now you will adjust a particle Emitter (a spot, where particles are created). The engine supports several emitter types. These types can be of a various form (point, parallelepiped, cylinder etc.) In this tutorial you will be using a point-like emitter.
In order to adjust the emitter, you have to select the Emitters parameter of the particle system and press the "..." button.
Now, press the Add button to add a PointEmitter.
Specify emitter parameters:
- set the Angle parameter to 30 (particle scatter angle),
- for the Color parameter set all sliders to 0 (instead of the initial value equal to 255),
- Set the Direction parameter to "0 0 1" (the initial direction of the particle flow),
- set the ParticleVelocity parameter to "1 2" (initial speed as an interval),
- set the TimeToLive parameter to "1 1" (particle lifetime as an interval),
And press the Ok button.
The emitter adjustment is complete.
Affector Adjustment
Now, you have to adjust the affectors, in other words, particle interaction and morphing over time. Particles may change in size and color.
In order to animate your particles, you have to create three affectors:
- affector, changing the color over time,
- affector, changing particle size,
- affector for particle rotation.
Select the Affectors parameter and press the "..." button.
First, adjust the affector, changing the system color. Fire has several specific features, that have to be taken into account: It is bright and semitransparent at the bottom, turning into orange light to the top. Then, particle color turns red and, finally, they disappear. In order to get such an effect, it is convenient to use the ColourInterpolaterAffector. With this affector you can specify several areas with different color and lifetime.
Press the Add button in the affector adjustment window in order to add a new ColourInterpolaterAffector.
Set the following value of its parameters:
- set the Item0Color parameter to "205 111 15 0".
- set the Item0 parameter to "0".
- set the Item1Color parameter to "205 111 15 255".
- set the Item1Time parameter to "0.2".
- set the Item2Color parameter to "255 0 0 0".
- set the Item2Time parameter to "1".
You have adjusted particle color change over time. Now, proceed to particle size change. To do this add a ScaleAffector using the Add button.
Set the value of the Adjust parameter to 0.5.
The last affector you have to adjust is the one for particle rotation. The affector for particle rotation is called RotationAffector. Add it using the Add button.
Set this affectors parameter value as the following:
- set the Rotation parameter to 0 359 degrees.
- set the RotationSpeed parameter to "-30 30".
You have completed affector adjustment.
Completing Particle Adjustment
Now, you only have to specify particle size. Set the value of the Size parameter of the particle system to"2 3".
Do not forget to save you particle system.
Congratulations, you have created a new particle system!
Particle System Parameters
| Name | Description |
|---|---|
| Affectors | Affector list. |
| Emitters | Emitter list. |
| MaterialName | Material name. |
| Renderer.AccurateFacing | Whether or not billboards should use an 'accurate' facing model based on the vector from each billboard to the camera, rather than an optimized version using just camera direction. |
| Renderer.BillboardOrigin | The point which acts as the origin point for all billboards in this set. |
| Renderer.BillboardRotation | Billboard rotation type. |
| Renderer.BillboardType | The type of the particle billboard (flat object turned towards the camera) being rendered. |
| Renderer.CommonDirection | The vector, along which the billboard is directed. |
| Renderer.CommonUpVector | A vector, specifiying the “upwards” direction for the particle billboard. |
| Renderer.PointRendering | Whether point rendering is enabled. |
| Size | Particle initial size. |
| AutomaticQuota | This parameter disables/enables the automatic detection of optimal particle number (the Quota property). |
| Quota | The maximal amount of active particles for the system. |
| CullIndividually | Specifies whether culling tests particles in this system (individually for each particle or for all system). |
| LocalSpace | Whether particles remain relative to the node the particle system is attached to. |
| Sorted | If this parameter is set to True, particles will be sorted by distance to the camera. |
Emitters
Emitters are particle generators and particle spawn points. There are several emitter types of different shape.
Emitter types:
- PointEmitter
- CylinderEmitter
- RingEmitter
- EllipsoidEmitter
- HollowEllipsoidEmitter
There properties that are common for all emitter types:
| Name | Description |
|---|---|
| Angle | Specifies the maximal particle scatter angle (degrees) from the emitter direction. If you set this parameter to 10, particles will deviate 10 degrees in any direction from the emitter. If you set this parameter to 180, particles will be emitted in all directions. If you set it to 0, particles will only be emitted in the direction, specified in the Direction parameter. |
| Color | Initial particle color. |
| Direction | Initial particle direction. |
| Duration | This parameter specifies emitter work time as an interval in seconds. With this value set to "0 0" the emitter will work permanently. |
| EmissionRate | This parameter specifies the number of particles emitted per second. By default, this parameter is set to 10 particles per second. |
| ParticleVelocity | Specifies minimal and maximal particle size. Particles will have a randon initial speed in the specified interval. |
| Position | Emitter position relative to the center. |
| RepeatDelay | Specifies wait time till next emission, if the system has completed its work and is out of particles. Sets the minimal and maximal time for the system to restart. The time period will be selected randomly within the given interval. |
| TimeToLive | Lifetime of separate particles. Particles will live a for a random time period from the given interval. |
Some emitters also have several additional properties to specify their size and form:
| Name | Description |
|---|---|
| InnerSize | Specifies the size of emitter inner part. |
| Size | Specifies emitter size. |
Affectors
Affectors are used for current particle system management, enabling the change of such parameters as color, rotation, scaling etc.
Emitter types:
- LinearForce
- ColourFader
- ColourFader2
- ColourInterpolator
- Scaler
- Rotator
- DirectionRandomiser (random direction affector)
- DeflectorPlane (particle deflector)
LinearForce Affector
This affector specifies additional forces to affect particle movement and direction. You can use it to similate gravity, wind or any other linear force.
This affector has 2 parameters:
| Name | Description |
|---|---|
| ForceApplication | Specifies the way, the force vector is applied to the particle. If this value is set to Add, the force vector will be added to the the particle movement impulse. This may result in infinite acceleration, though. If this parameter is set to Average, particle average speed will be calculated using the force vector and current particle impulse. This does not stabilize particle speed, as particle speed in this case is non-linear. |
| ForceVector | Force vector applied to the particle system. |
ColourFader Affector
This affector changes particle color over time.
This affector has only 1 parameter:
| Name | Description |
|---|---|
| Adjust | The adjustment to be made to each of the color components per second. These values will be added to the color of all particles every second, scaled over each frame for smooth adjustment. |
ColourFader2 Affector
This affector changes particle color over time. Unlike with the ColourFader affector, with this one you can adjust two colors at a time.
| Name | Description |
|---|---|
| Adjust1 | The adjustment to be made to each of the color components per second. These values will be added to the color of all particles every second, scaled over each frame for smooth adjustment. |
| Adjust2 | ??? |
ColourInterpolatоr Affector
Just like the ColourFader and the ColourFader2 affectors, this affector changes particle color, though does it in several stages. Each stage is activated at a certain time and has certain colors. Thus, this affector changes particle color at certain time intervals.
This affector has 12 parameters, though only 2 of them are unique:
| Name | Description |
|---|---|
| Item[...]Colour | Particle color. |
| Item[...]Time | Specifies the time for a certain stage to begin. |
Scaler Affector
This affector changes particle size over time. It can both increase or decrease particle size.
This affector has a single parameter:
| Name | Description |
|---|---|
| Adjust | This parameter specifies the “particle size change per second" factor. |
Rotator Affector
This affector manages particle rotation over time. The rotation effect is implemented by means of texture rotation.
| Name | Description |
|---|---|
| Rotation | This parameter specifies the maximal and the minimal angle for particle rotation. Thus, particle rotation will be implemented in the given interval. |
| RotationSpeed | This parameter specifies the maximal and the minimal speed of particle rotation. Thus, particle rotation speed will stay in the given interval. |
DirectionRandomiser Affector
This affector enables particle random movement. It has three parameters/
| Name | Description |
|---|---|
| KeepVelocity | Enables/disables particle speed change. If this is set to True, particle speed will not change. |
| Randomness | Makes particles randomly deflect in any of the three directions. |
| Scope | Particles will randomly deflect within the given scope. |
DeflectorPlane Affector
This affector creates a deflector plane, which deflects all particles coming in contact with it.
It has three parameters:
| Name | Description |
|---|---|
| Bounce | Specifies particle deflection force. If this parameter is set to 0.5, particle deflection force will be equal to 50% of the initial impulse. |
| PlaneNormal | Normal to the deflection plane. |
| PlanePoint | A point on the deflection plane. |

















