UDN
Search public documentation:

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

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 > Particle & Effects > Particles Systems > Distributions
UE3 Home > FX Artist > Distributions

Distributions


Overview


Distributions are a group of data types that provide flexibility by allowing for constant values, random values within a range, values interpolated along a curve, and values driven by parameters. These are generally used in properties of Particle Systems and nodes within SoundCues.

Distribution Types


Most particle properties utilize the DistributionFloat and DistributionVector types to allow for the maximum flexibility when creating particle systems. There are a variety of options available when using distribution types which will be detailed in the following sections.

Note that the actual usage of the value will vary, depending on the property that is using it. For example, the Initial Size of a particle is determined at the time that a particle spawns. If the distribution type is set to a constant curve for the property, then the emitter time at the spawning will be used to retrieve the desired value from the curve.

Float Distributions

Float distributions are utilized when there is a scalar property that is artist-controlled. An example would be the lifetime of a particle, or the spawn rate of the emitter.

DistributionFloatConstant

This type is used to supply a value for the property that is constant.

When selected as the type, the following dialog will be provided for editing the value:

FloatConstant.jpg

DistributionFloatConstantCurve

This type is used to supply a value for the property that is plotted on the graph editor over time. Whether the time is absolute (over the lifetime of the emitter) or relative (over the lifetime of the individual particle) is dependent on the module which utilizes the distribution.

When selected as the type, the following dialog will be provided for editing the value:

FloatConstantCurve.jpg

Note that all of the fields can be hand-edited, but utilizing the curve editor window is the suggested approach for editing these values.

DistributionFloatUniform

This type is used to supply a range of values for the property. When evaluated, the value returned will be randomly set within the selected range. When selected as the type, the following dialog will be provided for editing the value:

FloatUniform.jpg

DistributionFloatUniformCurve

This type is used to supply a range of values for the property that is plotted on the graph editor over time. When selected as the type, the following dialog will be provided for editing the value:

FloatUniformCurve.jpg

As with the ConstantCurve type, it is recommended that this distribution type be edited via the curve editor.

DistributionFloatParticleParam

This type is used to allow for simple game-code setting of parameters for emitters. It provides the ability to map input values from one range to another, allowing for tweaking of the parameter in "Cascade-space" without requiring game-play code to be updated. Once an established Input range is determined by the game-play coder, the artist is free to adjust the property through the Output mapping.

When selected as the type, the following dialog will be provided for editing the value:

FloatParticleParam.jpg

ParameterName is the name through which script-code will access the parameter.

MinInput and MaxInput are the range of values that can be passed into the parameter, typically by game-code.

MinOutput and MaxOutput are the values that are applied to the parameter in the particle system.

ParamMode determines how to use the input value. The following flags are supported:

ParamMode Flag Description
DPM_Normal Leave the input value alone.
DPM_Direct Use the input value directly (no remapping).
DPM_Absolute Use the absolute value of the input value before remapping.

Constant provides a default value to utilize as the input when the system can not find the named parameter.

Input to Output is linearly remapped, so: MinInput of 0 with a MaxInput of 5, MinOutput of 0 with a MaxOutput of 100 means that if you pass 2 in as your input, your output will be 40.

This is very useful for setting simple 0-1 inputs that map to multiple outputs, since you can share particle parameter variables by name. For example, you could set up the SpawnRate to be driven by Particle Parameter Foo, and set the inputs from 0-1, and the outputs from 20-200, and also use Foo in the InitialSize with the same inputs but an output of 10-20.

In code the programmer would write something like:

  ParticleComponent->SetFloatParameter('MyParameter', CurrentParameter);
  

DistributionFloatSoundParameter

This type is similar to DistributionFloatParticleParam, but for SoundCue's. It is used to modify properties of a SoundCue from code. For example, if you wanted an engine noise that raised in pitch as you drive, you would create a SoundCue for that noise and add a SoundNodeModulatorContinuous node. Then, for the PitchModulation property you would use a DistributionFloatSoundParameter.

Vector Distributions

Vector distributions are utilized when there is a vector-based property that is artist-controlled. An example would be the size or velocity of a particle.

DistributionVectorConstant

This type is used to supply a value for the property that is constant.

When selected as the type, the following dialog will be provided for editing the value:

VectorConstant.jpg

The LockedAxes flag allows for the user to lock the values of one axis to that of another. The following flags are supported:

LockedAxes Flag Description
EDVLF_None No axis is locked to another.
EDVLF_XY The Y-axis is locked to the X-axis value.
EDVLF_XZ The Z-axis is locked to the X-axis value.
EDVLF_YZ The Z-axis is locked to the Y-axis value.
EDVLF_XYZ The Y-and-Z-axes are locked to the X-axis value.

NOTE: When the lock flags are active, the values are NOT reflected in the property window setting. Ie, the Y value will not display the X contents when the LockedAxes flag is set to EDVLF_XY. Only when the value is retrieved from the distribution (in code) will the locked axes value be applied.

DistributionVectorConstantCurve

This type is used to supply a value for the property that is plotted on the graph editor over time. Whether the time is absolute (over the lifetime of the emitter) or relative (over the lifetime of the individual particle) is dependent on the module which utilizes the distribution.

When selected as the type, the following dialog will be provided for editing the value:

VectorConstantCurve.jpg

As with the FloatConstantCurve type, it is recommended that this distribution type be edited via the curve editor.

NOTE: When the LockedAxes flag is set to something other than EDVLF_None for a ConstantCurve distribution, the CurveEditor will not display the locked axis to avoid confusion. For example, if the flag is set to EDVLF_XY, the curve editor will contain only the X and Z curves.

DistributionVectorUniform

This type is used to supply a range of values for the property. When evaluated, the value returned will be randomly set within the selected range. When selected as the type, the following dialog will be provided for editing the value:

VectorUniform.jpg

The bUseExtremes flag indicates that the values should be selected as either Min or Max, clamping them to one of the two extremes.

The MirrorFlags allow for mirroring the Min/Max values for each component of the value. The following flags are supported for mirroring:

MirrorFlags Description
EDVMF_Same Use the Max value for Min as well.
EDVMF_Different Use each value as set.
EDVMF_Mirror Use �Max for Min.

DistributionVectorUniformCurve

This type is used to supply a range of values for the property that is plotted on the graph editor over time. When selected as the type, the following dialog will be provided for editing the value:

VectorUniformCurve.jpg

As with other curve types, it is recommended that this distribution type be edited via the curve editor.

DistributionVectorParticleParam

This type is the vector equivalent of the FloatParticleParam type discussed above.

When selected as the type, the following dialog will be provided for editing the value:

VectorParticleParam.jpg