In this article you'll find information on advanced techniques you can use with the Particle Editor to achieve better results.
Here is a description of the various ways you can attach particle emitters to other geometry, with particular emphasis on breakable geometry.
To attach particle effect to the other entity, use Link Object tool on editor and link particle effect entity to the source object entity at first. Then set AttachType and AttachForm in the particle effect entity parameter appropriately, not on particle editor. There are also AttachType and AttachForm in particle editor's parameter, but they only affect on the Second Particle from other geometry particle.
You can attach emitters to the parent particles, as part of the parent particle effect. If the parent effect has geometry, then the Second Generation effect can optionally emit particles from that geometry, based on its parameters. In this case, AttachType and AttachForm parameter are controlled from the Particle Editor.
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.
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 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 section of the script. This section has the following parameters:
Function | Description |
---|---|
Name | Particle effect name. This effect can, of course, have multiple child effects. |
Scale | Additional scale to multiply particle size quantities. |
Count_scale | Additional scale to multiply particle counts. |
Count_per_unit | True if particle count should be scaled by the extent of the attached geometry (length for edges, area for surface, etc). |
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:
Large Overdraw: For example, using several large particles (Count > 1 or 2, Size > 1m), additively blended to achieve dense, chaotic glows, refractions, etc. Instead of multiple overlaid sprites to provide chaotic variation and overall density, try the following techniques:
Large full screen particles should have the Fill Rate Cost set at 1 or above, as far as possible.
Soft Particles: Soft Particles and expensive shaders, such as refractive materials. These are quite expensive when used with several large particles. Use Soft Particles only on sub-emitters that are near the ground, and have only small particles. Create similar sub-emitters higher up, that emit particles that never intersect the ground, and don't need soft particles. For fire, use a horizontal glow texture. Combine that with some glow billboard sprites emitted higher up that don't intersect the ground. None of them need Soft Particles. Small particles don't need soft particle.
High-resolution textures: Use lower-res textures (if sharp details are not required), and texture compression.
High-count second-generation: Each 2nd-gen effect causes an emitter to be created for each particle in the parent effect. This can be quite nice, but somewhat expensive, so use sparingly.
Physics Parameters: Simple physics and rigid bodies are very expensive, even simple collision costs a lot of performance. In the event of wanting many colliding objects its best to clone the emitter with the colliding particles and make one only spawn about 20% of the other, and enable collisions only on this emitter. As long as some particles are colliding it will look like everything is colliding. If simple terrain collision is enough, set Bounciness > 0, and don't use rigid body. Consider splitting an effect into sub-effects, so that only a few particles (perhaps large ones) have Real Physics for appearance, and the rest just go through the ground or fade out quickly.
Geometry Particle: Drawcalls are added from using geometries as particles, one drawcall per mesh spawned. Where possible just use non camera aligned sprites using full rotations to resemble meshes at least in their rotation.
Small Particles: Small particles like sparks can have a max distance applied to them to make sure they aren't rendered even as very small, single pixel particles. Especially those with collisions, should be turned off for the lowest spec.
Turn off Diffuse Lighting: Diffuse lighting should not be used unless it is needed, for self lighting effects like sparks and explosions where they would create their own light the diffuse lighting slider should always be set to low.
Keep Short Duration: Keeping effects short in their lifetime obviously helps performance but it also makes the effect more powerful, coupled with a good sound. For explosions the shorter the fire stage of the explosion is the more believable it is. You don't have a chance to see the obvious textures used to create the structure of the effect. This applies to most effects in the game.
To use an effect as a muzzle flash, there is a rule to correctly attach effect to the helper of the weapon.
There is a special value for the Bounciness Physics
You can add some physical force by using Force Generation parameter in Physics tab. These are some examples of Force Generation.
Hierarchical Attracted Effect: As written in Basics/Child Effects above, you can make hierarchical effect. When you use Target to Force Generation parameter, you can make hierarchical attracted effect which has a specific, impressive movement.
You can see every sub particles are attracted to the parent effect's particle position through their life time. By repeating this procedure and do some tweak, you can make impressive effect which has very complex movement. Only Target force has a special rule that it's affect only on sub effects of its self.
Wind Force Effect: By adding wind force to the effect, you can blow the particles and vegetations around the spawning point of it. It's a powerful function to make explosive effects like hand grenade.
The appearance of the particle itself doesn't has any effect on force generation. You can add Count Value and tweak appearance if you want. Intensity of the wind force is controlled by the Speed value of the wind force effect, and affected effects must have value on Air Resistance.
Gravity Force Effect: You can also add gravity force to the effect. Intensity of the gravity force is controlled by the Gravity Scale value of the gravity force effect, and affected effects must have value on Gravity Scale.