This page describes the CryENGINE particle features and authoring environment.
Term | Description |
---|---|
Particle Effect | A specification for a particle effect, authored in the Sandbox and saved in XML effects libraries. Consists of one or more sub-effects. |
Particle Sub-Effect | A single Effect, specifying the creation of a number of particles of the same type. |
Particle Emitter | An instance of an Effect, spawned in game. Consists of a one or more sub-emitters. |
Particle Sub-Emitter | An instance of a single Sub-Effect. |
ParticleEffect Entity | An entity of class ParticleEffect , that specifies an effect to use, and is placed in a level; the usual way of creating permanent emitters in a level. |
Immortal Effect | An effect that has an indefinite lifetime (Continuous or Pulse Period properties are set). |
Emitters can be created in-game in 2 basic ways:
There are a couple ways to create a ParticleEffect entity:
The easiest is to open a Particles library from the Database window, select an effect, and drag it into the world.
The ParticleEffect entity has the following properties:
The ParticleEffect entity has the following events. You can Send them in the editor to test the effect, or send them from script.
In the Particle library editor are various tools for creating, deleting, and editing effects and libraries. There are a couple of handy buttons as well:
Following is the list of parameters, grouped as they are in the Library editing pane.
By default, particles emit from the emitter center in all directions equally. The following parameters change this behavior.
Particles can be either 2D (texture-based sprites) or 3D (geometry).
A summary of how lighting and blend parameters determine particle color:
If both Light Source Intensity and Radius are non-zero, then a dynamic light is generated for each particle.
This behavior is also affected by the console variable e_ParticlesLights :
e_ParticlesLights
Allows to have light source attached to every particle
0 = Off
1 = Deferred lights
Specifies how particles behave if the Emitter is attached externally to a #Target. By default, all particles are attracted to any target the emitter is linked to. These parameters customize that behavior.
These settings limit an effect to only be enabled on certain platform configurations. This allows you to create variant effects for different configurations.
Most numeric parameters have variation sub-fields, that allow for random variation, and evolution over particle and/or emitter lifetime. A variable parameter can have the following components:
In the Particles editor, variation params are initially unexpanded, and show just the base value. Click on the expand (+) widget next to the value to open up the variation params. When closed, this widget is colored if any variation values are non-default.
Spline curves default to unity, with 2 endpoints both set to 1.
To edit a spline curve:
The Color parameter works a little differently.
An effect can have any number of child effects, created and shown in the Sandbox as nested sub-effects. They can be nested to any level. There are 2 kinds of child effects:
The type of child effect is determined by the Second Generation flag in the child effect parameters.
Here is a description of the various ways you can attach particle emitters to other geometry, with particular emphasis on breakable geometry.
There are several ways to create breakable geometry in the engine. All are based on a CGF authored with multiple parts. All optionally allow secondary particle effects to be spawned on the broken pieces. I'll summarise these methods here, even though they aren't always particle-based:
Surface properties specify events that occur when something happens to an object with a particular physical material (surface) type. Surface types are identified by names (such as "wood" or "metal"). They can be specified on a render Material, and also on individual pieces or surfaces of a CGF. The properties for each surface type are specified in LUA scripts, stored in the Game/Scripts/Materials
directory.
Many of these properties specify particle effects which are spawned based on events such as "bullet" hit or "walk". The effect spawned when a geometry piece breaks off of an entity is specified on the breakage/particle_effect section of the script.
This section has the following parameters:
Particles can be set to move toward a target in several ways. The exact way in which particles move toward the target can be customized with the particle params in the TargetAttraction group.
Enter "e_ParticlesDebug 1", along with "r_DisplayInfo 1", in the console window, or User.cfg
file, to display basic particle stats on screen:
Enter "e_ParticlesDebug m+" to display particle memory stats on screen. All numbers are in KB:
Enter "e_ParticlesDebug b+" to display the bounding boxes and effect names of all particle emitters.
The bounding boxes are for entire emitters, including sub-emitters. The outer (darker) box is the box used by the renderer for all visibility determination. It is statically computed from the effect parameters and level environment, when the emitter is first initialized, or moved. The inner (dimmer) box is the actual bounding box of all current particles. It is computed only for this debug display. This display can be useful to find emitters that have unexpectedly large bounds, and thus viewing volume, due to parameters such as long particle lifetime or high speed.
The total number of particles in a scene is actually not very critical. Much more important are total fill-rate, physics, and (to some extent) spawn rate. So, in a framerate-challenged scene, try to avoid these things: