Particle Editor Extension

Tutorial


Particle Editor Extension Tutorial

This is a tutorial meant to give an introduction for the UE4 particle editor plugin, which can be purchased here.

Installation

Just use the Unreal Engine Launcher, where the plugin should be available in your library after the purchase. If you only have an archive file then extract it to your engine's plugin folder, e.g. "C:\Program Files (x86)\Epic Games\4.13\Engine\Plugins".

After the installation, you should see the plugin in your engine's plugin view, like this.

Usage

The following gives an overview of the plugin's modules and how to use them.

Table of contents

  1. Time settings
  2. Mesh surface
  3. Custom logic
  4. Turbulence
  5. Spiral galaxy
  6. Color by texture
  7. Heightmap
  8. Size by speed over time
  9. Force points
  10. Swarm movement
  11. Jiggle movement
  12. Donut shape
  13. Translucency sort order
  14. Decal component

Time settings

This is not a separate module, but every module of this plugin features three time settings that make it easy to create timed behaviour without using the curve editor (because we all know how much fun that is).

Parameters

StartDelay
The delay in milliseconds that a module is inactive before becoming active. An inactive module will not affect spawned particles or update existing particles. A duration of 0 means the module is never deactivated.
MaxDuration
The duration in milliseconds that a module is active. After the duration elapsed, the module will no longer affect newly spawned particles or update existing ones. A duration of zero means the module has no limitation on its runtime.
LoopAfter
The time in ms after which the module's timer is reset, meaning that it again waits for StartDelay milliseconds before it runs for MaxDuration milliseconds.


Mesh surface (static and procedural)

This module takes the surface (triangle) data of a given mesh and emits particles on the surface of the mesh. It is possible for the spawned particles to be equally distributed across the surface or to be equally distributed across triangles. They can also optionally start with a velocity in the direction of the surface normal where they spawn. Another powerful feature is the possibility to use generated or procedural meshes as input for the emitter. The triangle data for this dynamic type of mesh can either be provided via blueprint or via C++ class.

A few implementation notes: for static meshes, the module uses the physX runtime data, as the mesh triangles are not accessible by the CPU in a packaged build. This might cause problems where a custom physics mesh is used. Skeletal meshes are currently not supported; if you want to use them with the plugin then I might be able to add support for them. Another thing to remember is that for performance reasons, the complete mesh triangle data must be cached by the emitter. The necessary pre-calculations for the mesh cache are expensive and should not be triggered too often when using procedural meshes.

Spawning particles on the surface of a mesh that is generated at runtime works as follows:

  1. Have an actor implement the IMeshDataProvider interface, either in C++ or blueprint.
  2. In this actor, override the GetMeshTriangleData method. It must return the mesh data as two lists: 1. a list of vertices and 2. for the triangles a list of indices from the vertices list. Each triangle consists of 3 indices, which reference points from the vertices list.
  3. (Optional) If your mesh changes during the lifetime of the particle emitter and you want the emitter to always use the updated mesh, then you also have to override the GetDataRevision method. Just return a higher number every time the mesh data must be updated and the mesh module does the rest.
  4. Create your particle emitter with the mesh surface module.
  5. Create a name for the DynamicMeshParameterName parameter on the module.
  6. Once you spawned your emitter in the game, go to "Instance Parameters" and add an actor parameter with the name from the previous step and the actor from the first step. This can of course also be done via blueprint. For example, the particle emitter could be set as a component of an actor, which sets itself as emitter parameter at the start of the game. This is done by calling the "Set Actor Parameter" function on the particle component of the actor.

Please note that frequent changes of the supplied mesh might hurt performance. The IMeshDataProvider interface was designed in a way that you are in control of the update cycle for genereted mesh data.

Parameters

SurfaceMesh
The static mesh which surface should be used to emit the particles on.
DynamicMeshParameterName
Parameter for dynamic/procedural generated mesh data. The module will search for a parameter with the given name on the particle component.
The parameter must be of type actor and provide an instance of the IMeshDataProvider interface. This is used to inject the triangle data at runtime, e.g. from a pawn.
This parameter (when found) overrides the SurfaceMesh parameter, so you can use a static mesh to preview the effect in the particle editor and provide a generated mesh at runtime.
MeshTransform
Transformation to use on the mesh vertices.
EqualTriangeWeight
If true, each triangle has the same chance of spawning a particle, otherwise the triangles are weighted by area.
VelocityScale
Adds a velocity to each particle in the direction of the normal of the triangle that spawned it.


Custom Logic

Sometimes even the awesomeness of this plugin is not enough to satisfy your particle needs. If, for example, you want to place the spawned particles along a bezier curve or color them by velocity then this module is exactly right for you! It allows you to calculate each particle's properties within a blueprint or C++ class.

That means you are able to use actual live game data to derive particle properties in your blueprint without the need to add any additional modules inside the particle editor. For example, have a look at this video where the particles are spawned on a sine wave:

Note: The module is still experimental and WIP (the documentation here is for 4.13 and 4.14 only). In addition, some things like custom colors do not work with GPU particles.

Parameters

DataProviderParameterName
The module will search for a parameter with the given name on the particle component. The parameter must be of type actor and provide an instance of the AParticleDataProvider class. This can be used to provide a custom location, velocity, size, rotation, roation rate or color for spawned and updated particles.
UpdatedSpawnedParticles
If true, this module is used to update newly spawned particles.
UpdatedTickedParticles
If true, this module calls the data provider every tick to update the particle data. Does not work with GPU particles.
UseLocationFromProvider
If true, this module uses the position given by the custom data provider.
UseVelocityFromProvider
If true, this module uses the velocity given by the custom data provider.
UseSizeFromProvider
If true, this module updates particles with the size given by the custom data provider.
UseColorFromProvider
If true, this module uses the color given by the custom data provider.
UseRotationFromProvider
If true, this module updates particles with the rotation given by the custom data provider.
UseRotationRateFromProvider
If true, this module updates particles with the rotation rate given by the custom data provider.


Turbulence

This module adds a turbulence effect to the particle's velocity. Usually, this is done with vector fields, which have the advantage to also work with GPU particles. This module is more of a "quick and dirty" solution that can be used if no vector field is at hand or to quickly iterate and try different types of turbulence.
Note: watch your performance when applying the effect to many particles at once.

The turbulence is implemented by calculating a 3d curl-noise field and applying the field values and direction to the particles. The big advantage curl-noise has over other noise types such as perlin-noise is that there are no "sinks", meaning that particles cannot get trapped in a point in space.
The module works well with ribbons, which show how the noise field is shaped. It is also possible to apply the turbulence only in one or two directions; this can be helpful to create effects like falling snow. See the following video for an example:

Parameters

Intensity
Turbulence intensity in the x, y and z direction - larger values create faster movement. A value of zero disables turbulences for that direction.
LengthScale
How dense the turbulence field should be (dense = fast changing) - higher values mean less density.
Tightness
How tightly particles adhere to the turbulence field. 0: act like acceleration, 1: act like velocity.
MaxAcceleration
Max acceleration gained by turbulence field.
MaxVelocity
Max particle velocity after turbulence was applied.


Spiral Galaxy

This module uses a spiral shaped distribution model to place newly spawned particles. This can be used to great effect when creating spiral galaxies with GPU particles.
Note: since all particles from a single GPU type emitter share the same color, it is required to create several similar emitters within a single particle effect to create a good looking galaxy. See this tutorial for more information or check out the example project.

Parameters

StartLocation
The center location where the particles should be emitted.
Radius
The radius of the spiral. This is a range, meaning that is can be used to block particles from spawning at the center of the spiral, which is very helpful when creating star systems where old stars at the fringe have different colors.
DeltaAngle
The angle used to determine the twist of the spiral arms.
EllipseA
Size of the horizontal ellipse
EllipseB
Size of the vertical ellipse
DiscHeight
The height of the spiral disc.
FalloffFactor
A higher falloff factor spreads the particles more to the fringes of the spiral.


Color by texture

This module uses a static texture as a lookup table to adjust the particle color. Each particle within certain bounds is mapped via its position to a texture pixel. This can for example be used to mask spawned particles with the alpha channel of a texture or to have very fine control over the particles color distribution.

Particles with a position that cannot be mapped to a texture coordinate are not effected by this module.

Note: for performance reasons the module has to cache the uncompressed texture data in memory. Creating many effects with large textures can lead to problems.

Parameters

ColorIndexTexture
Each particle within the module bounds is mapped to a pixel of this texture. The particle color is changed based on the pixel color. The texture must be saved without mipmaps or compression!
MapBounds
The bounds for the module to work in. Only particles with x and y coordinates inside the bounds are affected by this module. Also, the min and max positions of the bounds are mapped to the min and max pixels of the color texture. If the bounds do not seem to work correctly, check if the emitter uses local space or world space.
Intensity
The value to multiply the texture color with.
UpdateWithTick
If true, then this module will set the particle color with every update. Does not work for GPU particles.
UseTextureAlpha
If true, then the alpha value will be extracted from the texture and used on the particle as well.
ParticleAxisToTextureX
The particle position axis to map to the texture's x axis.
ParticleAxisToTextureY
The particle position axis to map to the texture's y axis.


Heightmap

This module uses a static texture as a heightmap to adjust the particle height. This can for example be used to create particle effects in the shape of maps or to fit an effect to the terrain in a game.

Particles with a position that cannot be mapped to a texture coordinate are not effected by this module.

Note: for performance reasons the module has to cache the uncompressed texture data in memory. Creating many effects with large textures can lead to problems.

Parameters

HeightmapTexture
RGB texture where the color value (size of the color vector) determines the height of the particle mapped to the texture pixel. The texture must be saved without mipmaps or compression!
MapBounds
The bounds for the heightmap to work in. Only particles with x and y coordinates inside the bounds are affected by this module. Also, the min and max positions of the bounds are mapped to the min and max pixels of the heightmap texture. If the bounds do not seem to work correctly, check if the emitter uses local space or world space.
Intensity
The value to multiply the heightmap pixel value with for the height.
UpdateWithTick
If true, then this module will set the particle z-position with every update. This forces to module to no longer be additive to the particles current position, but set an absolute height for the particle. Does not work for GPU particles.
SmoothUpdate
If the tick update is enabled, this option determines if the particles should try to reach the height instantly or smoothly.


Size by speed over time

This module is basically the same as the vanilla "size by speed" module, but can change the scale factor over time. It can also be inverted, meaning that faster particles become smaller.

Parameters

Size
Size scale for each dimension over time.
InvertSpeed
If true then the particles get smaller the faster they are. A velocity of 0 still results in a size of 0.
MaxSize
The maximum size the particle can have, regardless of its speed.
MinSize
The minimum size the particle must have, regardless of its speed.


Force points

This module places several "force points" which attract or repel particles based on the distance to the particles. In addition, the module provides different weighting options for the distance: linear, quadratic, inverse linear and inverse quadratic.
For example, the linear option works like a rubber band while the inverse quadratic option works like gravity.

Keep in mind that every force point acts on every particle, so creating a lot of points and particles might lead to performance problems.

Parameters

Points
The coordinates of the points in space influencing the particles. Attention! Computation time scales linearly with the number of force points.
Intensity
Magnitude of the acceleration. positive = attract / negative = repel
SeparationDistanceWeight
Determines how to weight the distance between particles and the points to determine the acceleration. (linear, quadratic, inverse linear or inverse quadratic.)
DistanceScale
How to scale the distance values before weighting them. This is especially useful when using quadratic weighting.
DynamicForcePointProviderName
The module will search for a parameter with the given name on the particle component. The parameter must be of type AActor and implement the IForcePointDataProvider interface. This can be used to change the force points at runtime from a blueprint or C++ actor (the method is called each tick).
This parameter (when found) overrides the static module parameters, so you can use the module to preview the effect in the particle editor and still provide an actor at runtime.


Swarm movement

This module adds an experimental swarm behaviour to the particle emitter. Each particle becomes aware of each other particle and tries to fulfill all of the following rules:

Each rule has a weight behind it, to define how strongly it affects the acceleration of each particle.

The module is able to produce a wide variety of behaviours, depending on the settings and particle properties. It can for example be used to simulate birds, fish and insects, but it can also be used for magic effects or smoke columns.

Parameters

PerceptionRadius
The influence radius of each swarm particle. The bigger the radius the slower the computations are!
MaxAcceleration
The maximum acceleration for each particle. Higher values mean faster direction changes.
MaxVelocity
The maximum velocity for each particle.
SeparationWeight
Higher values mean particles want to be farther apart.
AlignmentWeight
Higher values mean particles want to go more in the direction the other particles go.
CohesionWeight
Higher values mean particles want to be more in the swarms center.
BlindspotAngleDeg
Defines a volume with a conical shape in the back of each particle where it is "blind", meaning it won't see other particles behind it.
SeparationDistanceWeight
Determines how to weight the distance between particles for the separation force.
SteeringTargetDistanceWeight
Determines how to weight the distance between particle and steering target for the attraction force.
SteeringTargets
This parameter defines fixed attraction points for the swarm particles. Each particle will steer to the nearest target in addition to the usual swarm movement. This can be useful e.g. to limit the swarm to certain bounds.
SteeringWeight
Higher values mean particles want to go more in the direction of the nearest steering target (if there are any).
DynamicSteeringPointProviderName
The module will search for a parameter with the given name on the particle component. The parameter must be of type AActor and implement the IForcePointDataProvider interface. This can be used to change the force points at runtime from a blueprint or C++ actor (the method is called each tick).
This parameter (when found) overrides all other parameters on steering, so you can use the module to preview the effect in the particle editor and still provide an actor at runtime.


Jiggle Location

This module adds a rapid random movent to each particle each tick. A simple module with a very low runtime cost. The result is something that reminds of insect movement and looks like this:

Parameters

Intensity
Jiggle intensity for each dimension over time - larger values jiggle more!


Donut Location

This module spawns particles inside a torus shape (a donut). Similar to the other "shape" modules like sphere or cylinder, it allows particles to only spawn on the surface. It also works with GPU particles, as can be seen in the example video:

Parameters

Center
The center of the donut shape; allows for translations to the shape.
MinRadius
The size of the "hole" in the middle of the shape.
MaxRadius
The radius of the outer edge of the shape.
SurfaceOnly
If true, the particles are only spawned on the hull of the donut shape.
IsFlat
If true, the shape is flattened (all particles have the same z value).


Translucency sort order

This module allows to change the translucency sort order of the particle emitter component. This is usually done from the component detail view in the owning actor blueprint, but this is sometimes not possible (e.g. when spawning new actors in sequencer). Be ware that this module should only be used once per particle system and overrides the component settings each tick.

Parameters

SortOrder
Translucent objects with a lower sort priority draw behind objects with a higher priority. Translucent objects with the same priority are rendered from back-to-front based on their bounds origin. Ignored if the object is not translucent. The default priority is zero.
Warning: This should never be set to a non-default value unless you know what you are doing, as it will prevent the renderer from sorting correctly. It is especially problematic on dynamic gameplay effects.


Decal Component

This module spawns spawns a decal for each particle and moves the decal components around as the particles move around. Make sure to use the correct rotation for the decals, because otherwise the effect will not look very good.
To use the particle color for the decal, create a vector input in the decal's material. Then input the material parameter name in the MaterialColorParameter field of the particle module. See the video below for more details.

Parameters

DecalMaterials
The materials to create the decals with. One of the materials is chosen randomly for each created decal.
DecalScale
The size of the created decals.
ScaleWithParticleSize
If true then the decal component's scale is multiplied by the particle size every tick (e.g. if you have a "size over life" module to change the particle's size).
DecalRotation
The rotation of the created decals (pitch, yaw and roll in degrees).
RotateToParticleVelocity
Changes the rotation of the decal each tick, so the forward vector points to the particle velocity.
SortOrder
Controls the order in which decal elements are rendered. Higher values draw later (on top). Setting many different sort orders on many different decals prevents sorting by state and can reduce performance.
MaterialColorParameter
If not empty then the particles updates the vector parameter with the given name on the decal material with their own color each tick. This is a workaround since the "particle color" node in the decal material does not produce the linked particle's color.
OptimizeDecalComponentUsage
If true then decal components will be kept around for some time (invisible) to be reused for newly spawned particles. Otherwise they will be directly destroyed when a particles is removed.