Particle System Initializers

From Valve Developer Community
Jump to: navigation, search
English (en)中文 (zh)Translate (Translate)
Category:Particle System

Initializers set up each particle's initial state. To add one to your system, set the Properties dropdown to "Initializer" and right-click in the window below. This will bring an "add..." popup.

Warning.pngWarning:Creating a particle system without an Initializer will cause the particle to spawn at the map's origin.

Alpha Random

Applies a random alpha value. 0 means transparent, 255 means opaque.

alpha_min
alpha_max
Minimum/maximum alpha for the particle.
alpha_random_exponent
[Todo]

Color Random

Causes each particle's color to be picked from a specified range of values, and/or allows the color of the world's lighting to tint it.

color1
color2
Together define the range of values from which particle may choose its color.
tint_perc
The degree to which local lighting affects particle color, as a normalised percentage.
tint control point
A single location from which lighting is to be sampled. Disables per-particle lighting if used.
tint control point movement threshold
Optimisation. The initializer only updates its tint lighting check if the control point has moved farther than this threshold since the last update.
tint clamp min/max
Clamps the lighting sample within the given range. Keeps lighting within an expected variance.

Cull relative to model

Culls particles individually within a model's volume

control_point_number
The control point to use for culling particles
cull outside instead of inside
Should we cull particles outside the hitbox set or inside. 0/1
hitbox set
The hitbox set to use to determine where the particles are culled
use only bounding box
Whether to use hitboxes to cull or the bounding box to cull. 0/1

Inherit Velocity

If the emitter is parented to a moving entity, it will add its own velocity to each particle.

velocity scale
Normalised percentage of the velocity to inherit. Can be higher than 100%.

Lifetime from Sequence

Sets a particle's lifespan based on the animation length of the sequence based at the given framerate. Used when a single particle type consists of many sequences with varying sequence lengths (some have 10 frames, others 60, but all must act appropriately without slow framerate, etc.)

If the 'use animation rate as FPS' flag of Render_Animated_Sprites has the same FPS settings, a particle will map it lifespan and animation together perfectly.

Frames Per Second
Sets the desired FPS for the animation. This is mapped to lifespan according to the number of frames in the sequence the particle receives via a sequence_random or other sequence-defining initializer.

Lifetime Random

Sets the lifetime of a particle within a given range.

Lifetime_min
Lifetime_max
Min/max lifetime for the particle in seconds.

Lifetime Pre-Age Noise

Treats a particle as if it has already spent part of its lifespan. All operators that test particle lifespan will act appropriately.

start age minimum
start age maximum
Minimum/maximum age to add to a particle.
time noise coordinate scale
This sets the scale of the time part of the noise function - based on particle spawn time. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar.
spatial noise coordinate scale
This sets the scale of the spatial part of the noise function - based on particle spawn location. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar. Time noise is added to spatial noise, so set one or the other to zero in order to receive no effect from that portion of the function.
time coordinate offset
This sets the offset on the noise function to draw from. Essentially moves the result of a given time input to a different seed.
spatial coordinate offset
This sets the offset on the noise function to draw from. Essentially moves the result of a given spatial input to a different seed.
absolute value
Noise returns -1 to 1 which is mapped to the output range. Using absolute value bool (0/1) , the output can have sudden shifts in direction as the number approaches zero and then bounces back into positives instead of going into negatives.
invert absolute value
Essentially flips the curve created by using the absolute value flag. So instead of getting sharp valleys, you get sharp peaks. The math is 1 minus the absolute value of the noise.

Move Particles Between 2 Control Points

Moves the particles between 2 control points at a value between the minimum and maximum speed. Can be extremely useful for particle tracers, laser sights/beams, and Halo-esque sniper-rifle trails.

Note.pngNote:Normally, this initializer moves particles to the end control point and leaves them there (i.e., if new particles are created, they will spawn at the end control point and immediately vanish). To get around this, add a "Position Along Path Sequential" initializer with start and end control points of 0 ABOVE the "Move Particles Between 2 Control Points" entry.
end control point
The point that the particles are moving to.
start offset
Offset of where the particles start relative to the starting control point and direction of movement.
end spread
The spread of the particles relative to the end control point. Think of this as how spray works with a gun.
maximum speed
The maximum speed the particle travels to the end control point.
minimum speed
The minimum speed the particle travels to the end control point.

Position Modify Offset Random

Moves the initial position of a particle in world or local space relative to its emission point. Can be used to emit particles along a line while still using parts of a sphere emitter or relative to a secondary control point.

offset min
XYZ minimum offset.
offset max
XYZ maximum offset.
Offset in local space
This bool (0/1) sets where to use world or local (emitter) space to do the offset.
offset relative to radius
This bool (0/1) sets whether to treat the offset values as an amount relative to the particle's radius. For example, if the offset is set to 0 0 1, and two particles have a radii of 32 and 64, they'd be moved vertically 32 and 64 units respectively.
control_point_number
The control point relative to which offset will occur.

Position Modify Warp Random

Warps the initial position of a particle in world or local space relative to its emission point. Can be used to stretch initial emission shapes. A sphere can be stretched into an ovoid, or smashed. Useful in addition to sphere emissions distance bias and absolute value to create squashed domes, rings (the elongated ring seen in Portal), etc. Warped particles initial speed is also warped by the corresponding amount. So particles that are stretched will have a higher initial velocity, while those that are squashed will have lower.

warp min
XYZ minimum warp.
warp max
XYZ maximum warp.
local coordinate space
This bool (0/1) sets where to use world or local (emitter) space to do the offset.
control_point_number
The control point relative to which warp will occur.
warp transition time
Treats the min/max as start and end sizes for a warp that takes place over the specified time. So the emission placement of each new particle will be warped over time.
warp transition start time
When the warp transition will start
reverse warp
In the case of a warp transition, it will make it run backwards (max to min)

Position Within Box Random

Particles are created at a random location inside a box with the given dimensions.

x_min
x_max
+/- X units
y_min
y_max
+/- Y units
z_min
z_max
+/- Z units
use local space
Note.pngNote:When use local space is true the system will spawn at world origin 0 0 0, and if it is false the system won't rotate with info_particle_system.
PlacementTip.pngWorkaround:You can work around this by using Position Within Sphere Random instead, with a radius of 0 and an addition of Position Modify Offset Random . Set the bounding box and check "offset in local space" to true, both in the Position Modify Offset Random.

Position Within Sphere Random

Initializes the particles inside of a sphere with a certain speed.

distance_min
Minimum distance to spawn from the center of the sphere.
distance_max
Maximum distance to spawn from the center of the sphere.
distance_bias
A bias to the distribution of particles in the system in X Y Z relative to each axis. 1 1 0 will create particles only in the X Y plane, while 1 1 10 will create roughly 10 times as many particles near the top and bottom of the sphere as on the X Y parts. Useful for creating discs, rings, and polar effects.
distance_bias_absolute_value
Setting any axis to one will eliminate particles from one hemisphere of the distribution. Can be used to create hemispheres, quarter spheres, etc. Use wil distance bias to alter the effect. Use negative values in distance bias to flip the hemisphere from one side to the other.
bias_in_local_system
Boolean (0/1) value which sets the biasing to use the local space of the emitter rather than world space.
control_point_number
Control point which to spawn relative to.
speed_min
Minimum initial speed of the particle emitted outward from the sphere.
speed_max
Maximum initial speed of the particle emitted outward from the sphere.
speed_random_exponent
The exponent which determines the biasing of particles towards one end or the other of the random range.
speed_in_local_coordinate_system_min
Local space minimum initial speed of the particle in x y z.
speed_in_local_coordinate_system_max
Local space maximum initial speed of the particle in x y z.

Radius Random

Initializes the particles with a random radius.

radius_min
Minimum radius for the particle.
radius_max
Maximum radius for the particle.

Remap Initial Scalar

Allows you to map any initial scalar to any other. Really useful for mapping creation time of a timed system to something else, like alpha to have a system that over time produces particles of higher or lower alpha for example.

input field
The field to read from
input minimum
The lower end to map from
input maximum
The upper end to map from
output field
The field to write to
output minimum
The lower end to map to
output maximum
The upper end to map to
output is scalar of initial random range
Rather than overwriting the original value of the output field, the remapped value is multiplied against the initial output field value
only active within specified input range
The input value will be remapped only if it's between input maximum and input minimum values

Remap Control Point to Scalar

Allows to convert the position of the control point along one of the axes into scalar parameter value

input control point number <int>
The number of the control point
input field 0-2 X/Y/Z <int>
Defines along wich axis will be taken the position of the control point. 0 = X, 1 = Y, 2 = Z
input maximum <float>
Maximum input value to map
input minimum <float>
Minimum input value to map
output field <choices>
Defines scalar parameter to write to
output is scalar of initial random range <boolean>
Rather than overwriting the original value of the output field, the remapped value is multiplied against the initial output field value
output maximum <float>
Maximum possible output value
output minimum <float>
Minimum possible output value
run for killed parent particles <boolean>
To do

Remap Noise to Scalar

Allows any scalar parameter to be initialized to a select range via a noise function. The noise function is mapped based on both time and space, each with their own coordinate scales and offsets. This creates a range of results that are non-random but vary based on creation time and position.

time noise coordinate scale
This sets the scale of the time part of the noise function - based on particle spawn time. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar.
spatial noise coordinate scale
This sets the scale of the spatial part of the noise function - based on particle spawn location. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar. Time noise is added to spatial noise, so set one or the other to zero in order to receive no effect from that portion of the function.
output field
The scalar to set the initial value on. Radius, Roll, Alpha, Life Duration, etc.
time coordinate offset
This sets the offset on the noise function to draw from. Two initial scalar noise functions set to different outputs (say alpha and radius) set to the same coordinate scales will behave the same. Offsets allow for the same scale mapping, but at a different part of the noise. So for example all small radius particles may have a high alpha rather than a low one if the offset is used.
spatial coordinate offset
This sets the offset on the noise function to draw from. Two initial scalar noise functions set to different outputs (say alpha and radius) set to the same coordinate scales will behave the same. Offsets allow for the same scale mapping, but at a different part of the noise. So for example all small radius particles may have a high alpha rather than a low one if the offset is used.
absolute value
Noise returns -1 to 1 which is mapped to the output range. Using absolute value bool (0/1) , the output can have sudden shifts in direction as the number approaches zero and then bounces back into positives instead of going into negatives.
invert absolute value
Essentially flips the curve created by using the absolute value flag. So instead of getting sharp valleys, you get sharp peaks. The math is 1 minus the absolute value of the noise.
output minimum
The lower boundary to map the noise to. This sets the lower range of what the resulting output will be. So for example, to create smoke with a minimum radius of 12, set this to 12.
output maximum
The upper boundary to map the noise to. This sets the upper range of what the resulting output will be. So for example, to create smoke with a maximum radius of 24, set this to 24. In the noted example, smoke radius will range from 12-24 based on the noise function.

Rotation Random

Starting from a base angle, randomly offsets the particle a certain number of degrees.

rotation_initial
Initial rotation for the particle (in degrees).
rotation_offset_min
Minimum number of degrees to randomly offset the particle.
rotation_offset_max
Maximum number of degrees to randomly offset the particle.

Rotation Speed Random

Used to specify a per-particle rotation speed. Use the operator Rotation Basic to update the particle's rotation based on its rotation speed.

rotation_speed_constant
A fixed speed in degrees/second
rotation_speed_random_min
Minimum number of degrees/second to randomly spin the particle.
rotation_speed_random_max
Maximum number of degrees/second to randomly spin the particle.
rotation_speed_random_exponent
Biases the random speed either toward the specified min or max. 1 = equally likely to be min or max. >1 = more often selects values closer to max, <1 = more often selects values closer to min
randomly_flip_direction
If 1, causes the spin to randomly be multiplied by -1 (switching between clockwise and counter-clockwise spin)

Sequence Random

Allows the particles to randomly start at a minimum and maximum supplied frame.

Example: This spritecard has a total of 6 frames. If 'sequence_min' was 2, and 'sequence_max' was 4, then the particles at 2,3, and 4 would be randomly selected when each particle is emitted.
sequence_min
The minimum starting sequence
sequence_max
The maximum starting sequence
Warning.pngWarning:Setting either of these to extremely high or negative values can cause crashes, so be careful!

Velocity Noise

Allows particle velocity to be initialized to a select range via a noise function. The noise function is mapped based on both time and space, each with their own coordinate scales and offsets. This creates a range of results that are non-random but vary based on creation time and position.

These particles use no random velocities, their velocity is defined by their initial velocity noise. Time with minor variations in position determine where they fire out to. You can see that over time they vary, but are not random.
time noise coordinate scale
This sets the scale of the time part of the noise function - based on particle spawn time. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar.
spatial noise coordinate scale
This sets the scale of the spatial part of the noise function - based on particle spawn location. Larger numbers will appear increasingly random, while very small numbers will map to a similar area of the noise and look very similar. Time noise is added to spatial noise, so set one or the other to zero in order to receive no effect from that portion of the function.
time coordinate offset
This sets the offset on the noise function to draw from. Essentially moves the result of a given time input to a different seed.
spatial coordinate offset
This sets the offset on the noise function to draw from. Essentially moves the result of a given spatial input to a different seed.
absolute value
Noise returns -1 to 1 which is mapped to the output range. Using absolute value bool (0/1) , the output can have sudden shifts in direction as the number approaches zero and then bounces back into positives instead of going into negatives.
invert absolute value
Essentially flips the curve created by using the absolute value flag. So instead of getting sharp valleys, you get sharp peaks. The math is 1 minus the absolute value of the noise.
output minimum
The lower boundary to map the noise to. This sets the minimum speed to give to a particle. Of course for particles moving in all directions, XYZ should all be negative.
output maximum
The upper boundary to map the noise to. This sets the maximum speed to give to a particle.

Velocity Repulse from World

Pushes the particles away from any nearby surfaces upon spawn. Traces are shot out in the cardinal directions from the specified control point. Particles receive a push in the most open direction if any nearby directions are blocked. Good for giving the impression of pressure imparted effects in enclosed areas.

minimum velocity
The minimum velocity scale that will be imparted on each axis if there is nothing blocking nearby the control point
maximum velocity
The maximum velocity scale that will be imparted, pushing away from any blocked directions
collision group
The collision group to test against. DEBRIS or NONE recommended.
control_point_number
The point to do the tests from.
Per Particle World Collision Tests
Will cause each particle to do its own test. SLOW - USE WITH CAUTION.
Use radius for Per Particle Trace Length
Makes the trace length of per particle tests the particle's radius
Trace Length
The distance to trace each direction.
Inherit from Parent
If set to true, the control point number field becomes the field to read data out of. Rather than doing traces, the initializer reads them from the control point. This is used for performance. A parent particle can do the test once, and all children can inherit the data rather than duplicating the same test many times over.
control points to broadcast to children (n + 1)
If broadcasting to children, this is the control point to start with. It requires 2 control points to store the data.
Child Group ID to affect
When broadcasting the CP, only send to children in this group ID.

Inherit Initial Value From Parent Particle

Copy's only the initial attribute value from its respective parent particle.

Inherited Field
Position, Radius, etc.
Particle Increment Amount
The next parent particle to use.
Random Parent Particle Distribution
Whether to randomly select particles to copy from.
Scale
Scale the inherited value.

Remap Initial Distance to Control Point to Scalar

Remaps only the initial distance a particle is to a control point to a particle scalar value. (Good for making effects that correlate to the distance the particle is to something.)

control point
The control point to remap to.
distance maximum
The maximum distance a particle can be affected by the control point.
distance minimum
The minimum distance a particle can be affected by the control point.
ensure line of sight 0/1
Should the line of sight to its control point be considered.
LOS collision group
The collision type to use when tracing.
LOS Failure scalar
[Todo]
Maximum trace length
The maximum length to trace for.
only active within specified distance.
Should only particles spawned within the distance be affected?
output field
The scalar parameter to write to. This can be (Radius, position, etc).
output is scalar of initial random range
Rather than overwriting the original value of the output field, the remapped value is multiplied against the initial output field value.
output maximum
The upper end to map to.
output minimum
The lower end to map to.

Scalar Random

Outputs a random scalar value to particles.

exponent
Sets the exponent used in the calculation of a random scalar value.
max
max value to set
min
min value to set
output field
Radius, yaw, roll, etc.

Vector Random

Outputs a random vector value to particles.

max
max value to set
min
min value to set
output field
Position, color, etc.

Remap Particle Count to Scalar

Remap the particle count value to a particle scalar value

input maximum
The maximum particle count value to read.
input minimum
The minimum particle count value to read.
only active within specified input range.
Should particles be affected within the input min and max?
output field
The scalar parameter to write to. This can be (Radius, position, etc).
output is scalar of initial random range
Rather than overwriting the original value of the output field, the remapped value is multiplied against the initial output field value.
output maximum
The upper end to map to.
output minimum
The lower end to map to.

Position On Grid

This creates particles along an X/Y/Z grid as specified.

[Todo]