UDN
Search public documentation:

UsingInstanceParameters
日本語訳
中国翻译
한국어

Interested in the Unreal Engine?
Visit the Unreal Technology site.

Looking for jobs and company info?
Check out the Epic games site.

Questions about support via UDN?
Contact the UDN Staff

UE3 Home > Particles & Effects > Particles Systems > Using Instance Parameters with Particle Systems
UE3 Home > FX Artists > Using Instance Parameters with Particle Systems

Using Instance Parameters with Particle Systems


Overview


Instance Parameters are a very powerful part of the effects pipeline in UE3. Particle Paramters can be used to control a multitude of values, on a per instance basis. Particle Parameters are often used on placed level effects, though they can also be called by game code to control various modules.

Controlling Color Through Parameters


For this demonstration we will control the color of a fire particle system using the ScaleColorLife module, setup with a ParticleParameter.

fireexample.jpg

First open your effect in Cascade, and make certain you have an initialColor or ColorOverLife module in your particle system.

Next add the Color > ScaleColor/Life module to your system. In the case of ScaleColor/Life the parameter gets utilized very often so setup is as easy as right-clicking and choosing Set up particle parameter. Note: this is not the case with all particleParameters.

setupparameter.jpg

If you select the module and view it's properties you can see vector and constant values have been defined for this module, The Parameters have been automatically named Color and Alpha, it is possible to modify this name and have multiple Parameter names in any particle system, placed on unique emitter stacks.

cascadeparameters.jpg

Setting up the Instance Parameter

The next step involves the individual EmitterActor placed in the scene. Select the EmitterActor and right-click, then choose Emitter > AutoPopulate from the drop down menu.

autopopulate.jpg

Your particle system may disappear at this point, depending upon your alpha/color settings and blend mode, this is normal behavior. Open up the EmitterActor's property window by pressing F4.

Located in the ParticleSystemComponent section is a newly generated set of data under the Instance Parameters section. Instance Parameters should now look Bold.

instanceparams.jpg

You will see the two parameters which were specified in your effect, to the right, with their names listed. Open up the parameter and edit the settings, Vector for RGB and Scalar for Alpha as circled below.

editedparams.jpg

The original placed effect:

originaleffect.jpg

The same effect manipulated with a particleParameter on the emitterActor to have more bloom and color saturation:

modifiedeffect.jpg

It is possible to use the color parameter to create one particle effect, and manipulate the color as needed without having to copy/paste multiple effects into your packages for basic color variation across different levels.

ParticleParameters can make organizing and finding effects much simpler, reduce memory, level load times, and reduce the amount of files required to be stored on disk.

Controlling Location Through Parameters (Reducing EmitterActor counts)


In this demonstration we will show how to use a particle parameter to control the initialLocation of an emitter, using a particle parameter can add add flexibility to your effects allowing for the use of fewer effects emitters in a scene.

For this example we will be referencing this fire effect.

locationeffect.jpg

Note: the effect is intended for usage over a wide area, with two main sources of flame at the origin of the emitter and fwd in X, Y. Using a particle parameter we can modify the look of this effect, and only load one particle system into memory.

Below is the same effect modified with a particle parameter:

locationeffectparam.jpg

Setting Up the Particle Parameter

Using a single emitter we will move the position of our effect with a particle parameter.

basiceffect.jpg

Right Click and add an Initial Position module to your Emitter in Cascade.

Select the Initial Location module and in the Distribution List choose DistributionVectorParticleParameter.

distributionparam.jpg

Change the Parameter Name to InitialPosition or any parameter name you choose, just make it unique for this emitter, unless you wish to share position values across multiple emitters using a shared particle parameter.

paramname.jpg

Open the Param Modes section and change the drop downs to DPM_Direct

parammodes.jpg

Select your Emitter Actor placed in the world and setup the particle parameter by right clicking and choosing Emitter > AutoPopulate.

Press F4 to view the emitter properties in the Particle System Component section. Note the Instance parameter section is now bold and contains a [0] entry. The name in this entry should match the name in your module's of IntialPosition

instancename.jpg

Change the Vector values to match whatever the desired position.

instancevalues.jpg

Before using a particle parameter to control position:

beforelocation.jpg

After using a particle parameter to control position:

afterlocation.jpg

This demonstration is a simplified example of using particle parameters, there are many uses for this feature which may prove to be a savings for your project.

Using one EmitterActor to place 3 fires using a particle parameter with a unique name on 3 unique emitters in Cascade:

finallocation.jpg

It is essential when working with complex effects to name your particle parameters clearly, returning to an older effect with poorly name parameters can be a confusing process which may waste time deducing how the parameters work. It is possible to use multiple particle parameters to control behavior across several modules in a single emitter or multiple emitters. Try editing color, position, scale, lifetime etc. It can prove beneficial to experiment with different settings to achieve the desired result.

In this particular case a particle parameter can be used to move the position of effect elements around in a scene, reducing emitterActor counts which in turn can help performance and load times. It is also possible to control particle parameters through matinee and game code.