Particle System Operators

From Valve Developer Community
Revision as of 22:30, 3 July 2008 by Mdurand (talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Common Operators

Generally all particle systems need a basic_movement operator and a lifespan_decay. All particles need basic_movement in order to move at all. Also, without a lifespan_decay, particles will not be destroyed once their lifespan is up (the alpha_fade operator is an early operator that also includes lifespan_decay in it, so it also will provide the same function, thus a lifespan_decay isn't needed when used with an alpha_fade operator.)

General Operations

Operator Fade In/Fade Out/Fade Oscillate - These are standard operators that work on all operators. Depending on the operator, the fade component may or may not work, but rather it may be a binary effect.

In and Out times are relative to the emitter lifespan, so an operator that fades in after 3 seconds does so relative to the emitters life, not the individual particle.

If an oscillation time is set, fade in and fade out times become 0.0 to 1.0 times relative to that oscillation time. That is if you wish your operator to oscillate in and out, setting an oscillation time of 4, a fade in of .25 and a fade out of .75 would mean that the operator has no effect for 1 second (one quarter the oscillation cycle time), works for 2 seconds (.25-.75), fades back out at 3 (three quarters of the oscillation cycle time), and then the cycle loops at the 4th second back to the start.


Lifespan Decay

Deletes a particle when its lifespan expires. Takes no parameters. Without this or alpha_fade your particles will never expire.


Alpha Fade and Decay

Fades a particle's alpha value to specified values over a specified time, then kills the particle.

Parameter Description
start_alpha The alpha that the particle will fade in from. It will fade to its initialized alpha.
end_alpha The alpha the particle will fade out to.
start_fade_in_time Time at which to begin to fade in (proportion of lifespan).
end_fade_in_time Time at which to end to fade in (proportion of lifespan).
start_fade_out_time Time at which to begin fading out the particle (proportion of lifespan).
end_fade_out_time Time at which to end fading out the particle (proportion of lifespan).


Alpha Fade In Random

Fades a particle in from 0 alpha with random range of time in absolute or proportional time.

Parameter Description
fade in time min The minimum time the particle will fade in over.
fade in time max The maximum time the particle will fade in over.
fade in time exponent A bias to the random range which alters the distribution curve.
proportional 0/1 This allows the fade in time range to be treated as a fraction of the lifespan of the particle (1) or absolute seconds (0).


Alpha Fade Out Random

Fades a particle out from it's initial alpha to 0 with random range of time in absolute or proportional time. Proportion or absolute time is calculated from the end of the particle's lifespan. For example, a .25 setting in proportional mode will cause the particle to fade over the last quarter of its lifespan, while 2 in nonproportional would be the last 2 seconds of its life. --alpha_fade_out does not include a lifespan_decay--

Parameter Description
fade out time min The minimum time the particle will fade in over.
fade out time max The maximum time the particle will fade in over.
fade out time exponent A bias to the random range which alters the distribution curve.
proportional 0/1 This allows the fade out time range to be treated as a fraction of the lifespan of the particle (1) or absolute seconds (0).


Color Fade

Fades the color of a particle to a target color over a given amount of time.

Parameter Description
color_fade Color to fade to.
color_fade_time Time over which to fade the color (seconds).


Movement Basic

Allows for basic movement of the particle through space.

Parameter Description
gravity Gravity to apply to the particle.
drag Drag to apply to the velocity of the particle.


Rotation Spin Roll

Adds rotational spin to the particle, including spinning down and minimum spin.

Parameter Description
spin_rate_degrees Rate at which to spin (degrees).
spin_stop_time Time at which to be at the minimum speed (seconds).
spin_rate_min Minimum spin to be at when the stop time is past (degrees).


Roation Spin Yaw

Adds rotational spin to the particle's yaw axis, including spinning down and minimum spin. Works just like the roll rotation spin.

Parameter Description
spin_rate_degrees Rate at which to spin (degrees).
spin_stop_time Time at which to be at the minimum speed (seconds).
spin_rate_min Minimum spin to be at when the stop time is past (degrees).

Radius Scale

Scales the radius of the particle over time.

Parameter Description
start_time Time at which to begin the scaling (second).
end_time Time at which to end the scaling (seconds).
radius_start_scale Scale value at the beginning of the scaling.
radius_end_scale Scale value at the end of the scaling.
ease_in_and_out Spline scaling curve.
scale_bias Bias the curve towards either end (0..1)

Movement Lock to Controlpoint

Forces the position of a particle to that of some control point on the emitter.

Parameter Description
start_fadeout_min Bottom range of time to start fading out the lock (leave the particle behind).
start_fadeout_max Top range of time to start fading out the lock (leave the particle behind).
end_fadeout_min Bottom range of time to end fading out the lock. Particle will be fully disengaged from the control points movement at this point.
end_fadeout_max Top range of time to end fading out the lock. Particle will be fully disengaged from the control points movement at this point.
start/end exponents Bias on the selection within the range.
control point number Which control point to lock to
fade distance particles will detach as they approach this distance
lock rotation this will update a particle relative to a CP's rotation as well as position.

Movement Lock to Bone

Lock to Bone works like the Position Lock to Control Point operator, but is used in combination with the random position on model initializer. Given a particle is emitted from a particular bone, it will update its position based on the specific movement of that bone.

Parameter Description
control_point_number The control point that references the model in question.
lifestime start fade The time at which to start fading the lock - relative to particle lifespan (0-1).
lifetime end fade The time at which to end (fully detach) the lock - relative to particle lifespan (0-1).



Oscillate Scalar

Oscillates a scalar output value at a certain rate and frequency. This can be used to creating flashing, glowing, pulsing particles or more subtle effects. The start and end timings are useful for creating an effect which occurs only once other operators have reached a desired effect, etc. Multiple oscillators of the same type can be applied to create multiple levels of effects (such as a particle which slowly pulses between small and large, but is also constantly minorly jittering in size as it does so).

Scalars are mapped to a sin wave oscillation. A few sample frequencies have been marked.
Parameter Description
proportional This bool sets whether to oscillate at the specified frequency over the lifespan of the particle (1) or per second (0)
oscillation frequency max Top range of frequency of oscillation. Depending on whether proportional is set, this frequency will map to the lifespan of the particle or per second. A high frequency will cause the particle to strobe, while anything lower than .25 can be used to apply a more constant direction of the rate rather than an oscillating effect.
oscillation frequency min Bottom range of frequency of oscillation. Depending on whether proportional is set, this frequency will map to the lifespan of the particle or per second. A high frequency will cause the particle to strobe, while anything lower than .25 can be used to apply a more constant direction of the rate rather than an oscillating effect.
oscillation rate max Top range of rate of change applied. This defines how much the particular output field changes per frame. Some fields (such as alpha) will be automatically clamped from 0.0 to 1.0, while others, such as radius, are not capped.
oscillation rate min Bottom range of rate of change applied. This defines how much the particular output field changes per frame. Some fields (such as alpha) will be automatically clamped from 0.0 to 1.0, while others, such as radius, are not capped.
oscillation field What parameter is oscillated. This can be alpha, radius, roll, etc.
start time min/max A range defining when to start applying the oscillation. Start/End proportional flag defines whether this is relative to the lifespan of the particle or a strict time in seconds.
end time min/max A range defining when to stop applying the oscillation. Start/End proportional flag defines whether this is relative to the lifespan of the particle or a strict time in seconds.
oscillation multiplier This is a simple multiplier for the oscillation rate min/maxes.
oscillation start phase This is where on the sin curve oscillation begins.

Oscillate Vector

Oscillates a vector output value at a certain rate and frequency. This can be used to create weaving, squiggling particles and so forth. The start and end timings are useful for creating an effect which occurs only once other operators have reached a desired effect. Multiple oscillators of the same type can be applied to create multiple levels of effects (such as a bug particle which slowly weaves about on a large scale at random and squiggles constantly as it moves).

Scalars are mapped to a sin wave oscillation. A few sample frequencies have been marked.
Parameter Description
proportional This bool sets whether to oscillate at the specified frequency over the lifespan of the particle (1) or per second (0)
oscillation frequency max Top range of frequency of oscillation. Depending on whether proportional is set, this frequency will map to the lifespan of the particle or per second. A high frequency will cause the particle to quickly move back and forth, while anything lower than .25 can be used to apply a more constant direction of the rate rather than an oscillating effect.
oscillation frequency min Bottom range of frequency of oscillation. Depending on whether proportional is set, this frequency will map to the lifespan of the particle or per second. A high frequency will cause the particle to quickly move back and forth, while anything lower than .25 can be used to apply a more constant direction of the rate rather than an oscillating effect.
oscillation rate max Top range of rate of change applied. This defines how much the particular output field changes per frame. Color will be automatically clamped from 0 to 255, while position is not capped.
oscillation rate min Bottom range of rate of change applied. This defines how much the particular output field changes per frame. Color will be automatically clamped from 0 to 255, while position is not capped.
oscillation field What parameter is oscillated. This can be color or position.
start time min/max A range defining when to start applying the oscillation. Start/End proportional flag defines whether this is relative to the lifespan of the particle or a strict time in seconds.
end time min/max A range defining when to stop applying the oscillation. Start/End proportional flag defines whether this is relative to the lifespan of the particle or a strict time in seconds.
oscillation multiplier This is a simple multiplier for the oscillation rate min/maxes.
oscillation start phase This is where on the sin curve oscillation begins.


Movement Dampen Relative to Control Point

This operator suppresses movement as a particle approaches the specified control point. This can be used with lock to control point (and it's distance fade option) to have CPs "capture" particles near them and draw them along with them. It can also lock endpoints of a line of particles while allowing the middle section to move freely.

Parameter Description
control_point_number The control point to dampen relative to.
falloff range The distance over which the dampening will fall off.
dampen scale The strength of the movement dampening.