Class CPUParticles3D
A CPU-based 3D particle emitter.
- Inheritance
-
CPUParticles3D
Remarks
CPU-based 3D particle node used to create a variety of particle systems and effects.
See also GPUParticles3D, which provides the same functionality with hardware acceleration, but may not run on older devices.
See Also
Properties
amount
Number of particles emitted in one emission cycle.
var amount : int = 8
Property Value
Remarks
angle_curve
var angle_curve : Curve
Property Value
Remarks
angle_max
Maximum angle.
var angle_max : float = 0.0
Property Value
Remarks
angle_min
Minimum angle.
var angle_min : float = 0.0
Property Value
Remarks
angular_velocity_curve
Each particle's angular velocity (rotation speed) will vary along this Curve over its lifetime. Should be a unit Curve.
var angular_velocity_curve : Curve
Property Value
Remarks
angular_velocity_max
Maximum initial angular velocity (rotation speed) applied to each particle in degrees per second.
var angular_velocity_max : float = 0.0
Property Value
Remarks
angular_velocity_min
Minimum initial angular velocity (rotation speed) applied to each particle in degrees per second.
var angular_velocity_min : float = 0.0
Property Value
Remarks
anim_offset_curve
var anim_offset_curve : Curve
Property Value
Remarks
anim_offset_max
Maximum animation offset.
var anim_offset_max : float = 0.0
Property Value
Remarks
anim_offset_min
Minimum animation offset.
var anim_offset_min : float = 0.0
Property Value
Remarks
anim_speed_curve
var anim_speed_curve : Curve
Property Value
Remarks
anim_speed_max
Maximum particle animation speed.
var anim_speed_max : float = 0.0
Property Value
Remarks
anim_speed_min
Minimum particle animation speed.
var anim_speed_min : float = 0.0
Property Value
Remarks
color
Each particle's initial color.
Note: color multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, vertex_color_use_as_albedo must be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, color will have no visible effect.
var color : Color = Color(1, 1, 1, 1)
Property Value
Remarks
color_initial_ramp
Each particle's initial color will vary along this Gradient (multiplied with color).
Note: color_initial_ramp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, vertex_color_use_as_albedo must be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, color_initial_ramp will have no visible effect.
var color_initial_ramp : Gradient
Property Value
Remarks
color_ramp
Each particle's color will vary along this Gradient over its lifetime (multiplied with color).
Note: color_ramp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, vertex_color_use_as_albedo must be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, color_ramp will have no visible effect.
var color_ramp : Gradient
Property Value
Remarks
damping_curve
var damping_curve : Curve
Property Value
Remarks
damping_max
Maximum damping.
var damping_max : float = 0.0
Property Value
Remarks
damping_min
Minimum damping.
var damping_min : float = 0.0
Property Value
Remarks
direction
Unit vector specifying the particles' emission direction.
var direction : Vector3 = Vector3(1, 0, 0)
Property Value
Remarks
draw_order
Particle draw order. Uses DrawOrder values.
var draw_order : int = 0
Property Value
Remarks
emission_box_extents
The rectangle's extents if emission_shape is set to CPUParticles3D.EMISSION_SHAPE_BOX.
var emission_box_extents : Vector3
Property Value
Remarks
emission_colors
Sets the Colors to modulate particles by when using CPUParticles3D.EMISSION_SHAPE_POINTS or CPUParticles3D.EMISSION_SHAPE_DIRECTED_POINTS.
Note: emission_colors multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, vertex_color_use_as_albedo must be true
. For a ShaderMaterial, ALBEDO *= COLOR.rgb;
must be inserted in the shader's fragment()
function. Otherwise, emission_colors will have no visible effect.
var emission_colors : PackedColorArray = PackedColorArray()
Property Value
Remarks
- void set_emission_colors(PackedColorArray value)
- PackedColorArray get_emission_colors
emission_normals
Sets the direction the particles will be emitted in when using CPUParticles3D.EMISSION_SHAPE_DIRECTED_POINTS.
var emission_normals : PackedVector3Array
Property Value
Remarks
- void set_emission_normals(PackedVector3Array value)
- PackedVector3Array get_emission_normals
emission_points
Sets the initial positions to spawn particles when using CPUParticles3D.EMISSION_SHAPE_POINTS or CPUParticles3D.EMISSION_SHAPE_DIRECTED_POINTS.
var emission_points : PackedVector3Array
Property Value
Remarks
- void set_emission_points(PackedVector3Array value)
- PackedVector3Array get_emission_points
emission_ring_axis
The axis of the ring when using the emitter CPUParticles3D.EMISSION_SHAPE_RING.
var emission_ring_axis : Vector3
Property Value
Remarks
emission_ring_cone_angle
The angle of the cone when using the emitter CPUParticles3D.EMISSION_SHAPE_RING. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other.
Note: Depending on emission_ring_height, the angle may be clamped if the ring's end is reached to form a perfect cone.
var emission_ring_cone_angle : float
Property Value
Remarks
emission_ring_height
The height of the ring when using the emitter CPUParticles3D.EMISSION_SHAPE_RING.
var emission_ring_height : float
Property Value
Remarks
emission_ring_inner_radius
The inner radius of the ring when using the emitter CPUParticles3D.EMISSION_SHAPE_RING.
var emission_ring_inner_radius : float
Property Value
Remarks
emission_ring_radius
The radius of the ring when using the emitter CPUParticles3D.EMISSION_SHAPE_RING.
var emission_ring_radius : float
Property Value
Remarks
emission_shape
Particles will be emitted inside this region. See EmissionShape for possible values.
var emission_shape : int = 0
Property Value
Remarks
emission_sphere_radius
The sphere's radius if EmissionShape is set to CPUParticles3D.EMISSION_SHAPE_SPHERE.
var emission_sphere_radius : float
Property Value
Remarks
emitting
If true
, particles are being emitted. emitting can be used to start and stop particles from emitting. However, if one_shot is true
setting emitting to true
will not restart the emission cycle until after all active particles finish processing. You can use the finished signal to be notified once all active particles finish processing.
var emitting : bool = true
Property Value
Remarks
explosiveness
How rapidly particles in an emission cycle are emitted. If greater than 0
, there will be a gap in emissions before the next cycle begins.
var explosiveness : float = 0.0
Property Value
Remarks
fixed_fps
The particle system's frame rate is fixed to a value. For example, changing the value to 2 will make the particles render at 2 frames per second. Note this does not slow down the particle system itself.
var fixed_fps : int = 0
Property Value
Remarks
flatness
Amount of spread in Y/Z plane. A value of 1
restricts particles to X/Z plane.
var flatness : float = 0.0
Property Value
Remarks
fract_delta
If true
, results in fractional delta calculation which has a smoother particles display effect.
var fract_delta : bool = true
Property Value
Remarks
gravity
Gravity applied to every particle.
var gravity : Vector3 = Vector3(0, -9.8, 0)
Property Value
Remarks
hue_variation_curve
var hue_variation_curve : Curve
Property Value
Remarks
hue_variation_max
Maximum hue variation.
var hue_variation_max : float = 0.0
Property Value
Remarks
hue_variation_min
Minimum hue variation.
var hue_variation_min : float = 0.0
Property Value
Remarks
initial_velocity_max
Maximum value of the initial velocity.
var initial_velocity_max : float = 0.0
Property Value
Remarks
initial_velocity_min
Minimum value of the initial velocity.
var initial_velocity_min : float = 0.0
Property Value
Remarks
lifetime
Amount of time each particle will exist.
var lifetime : float = 1.0
Property Value
Remarks
lifetime_randomness
Particle lifetime randomness ratio.
var lifetime_randomness : float = 0.0
Property Value
Remarks
linear_accel_curve
var linear_accel_curve : Curve
Property Value
Remarks
linear_accel_max
Maximum linear acceleration.
var linear_accel_max : float = 0.0
Property Value
Remarks
linear_accel_min
Minimum linear acceleration.
var linear_accel_min : float = 0.0
Property Value
Remarks
local_coords
If true
, particles use the parent node's coordinate space (known as local coordinates). This will cause particles to move and rotate along the CPUParticles3D node (and its parents) when it is moved or rotated. If false
, particles use global coordinates; they will not move or rotate along the CPUParticles3D node (and its parents) when it is moved or rotated.
var local_coords : bool = false
Property Value
Remarks
mesh
The Mesh used for each particle. If null
, particles will be spheres.
var mesh : Mesh
Property Value
Remarks
one_shot
If true
, only one emission cycle occurs. If set true
during a cycle, emission will stop at the cycle's end.
var one_shot : bool = false
Property Value
Remarks
orbit_velocity_curve
var orbit_velocity_curve : Curve
Property Value
Remarks
orbit_velocity_max
Maximum orbit velocity.
var orbit_velocity_max : float
Property Value
Remarks
orbit_velocity_min
Minimum orbit velocity.
var orbit_velocity_min : float
Property Value
Remarks
particle_flag_align_y
Align Y axis of particle with the direction of its velocity.
var particle_flag_align_y : bool = false
Property Value
Remarks
particle_flag_disable_z
If true
, particles will not move on the Z axis.
var particle_flag_disable_z : bool = false
Property Value
Remarks
particle_flag_rotate_y
If true
, particles rotate around Y axis by angle_min.
var particle_flag_rotate_y : bool = false
Property Value
Remarks
preprocess
Particle system starts as if it had already run for this many seconds.
var preprocess : float = 0.0
Property Value
Remarks
radial_accel_curve
var radial_accel_curve : Curve
Property Value
Remarks
radial_accel_max
Maximum radial acceleration.
var radial_accel_max : float = 0.0
Property Value
Remarks
radial_accel_min
Minimum radial acceleration.
var radial_accel_min : float = 0.0
Property Value
Remarks
randomness
Emission lifetime randomness ratio.
var randomness : float = 0.0
Property Value
Remarks
scale_amount_curve
var scale_amount_curve : Curve
Property Value
Remarks
scale_amount_max
Maximum scale.
var scale_amount_max : float = 1.0
Property Value
Remarks
scale_amount_min
Minimum scale.
var scale_amount_min : float = 1.0
Property Value
Remarks
scale_curve_x
Curve for the scale over life, along the x axis.
var scale_curve_x : Curve
Property Value
Remarks
scale_curve_y
Curve for the scale over life, along the y axis.
var scale_curve_y : Curve
Property Value
Remarks
scale_curve_z
Curve for the scale over life, along the z axis.
var scale_curve_z : Curve
Property Value
Remarks
seed
Sets the random seed used by the particle system. Only effective if use_fixed_seed is true
.
var seed : int = 0
Property Value
Remarks
speed_scale
Particle system's running speed scaling ratio. A value of 0
can be used to pause the particles.
var speed_scale : float = 1.0
Property Value
Remarks
split_scale
If set to true
, three different scale curves can be specified, one per scale axis.
var split_scale : bool = false
Property Value
Remarks
spread
Each particle's initial direction range from +spread
to -spread
degrees. Applied to X/Z plane and Y/Z planes.
var spread : float = 45.0
Property Value
Remarks
tangential_accel_curve
var tangential_accel_curve : Curve
Property Value
Remarks
tangential_accel_max
Maximum tangent acceleration.
var tangential_accel_max : float = 0.0
Property Value
Remarks
tangential_accel_min
Minimum tangent acceleration.
var tangential_accel_min : float = 0.0
Property Value
Remarks
use_fixed_seed
If true
, particles will use the same seed for every simulation using the seed defined in seed. This is useful for situations where the visual outcome should be consistent across replays, for example when using Movie Maker mode.
var use_fixed_seed : bool = false
Property Value
Remarks
visibility_aabb
The AABB that determines the node's region which needs to be visible on screen for the particle system to be active.
Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The AABB can be grown via code or with the Particles → Generate AABB editor tool.
var visibility_aabb : AABB = AABB(0, 0, 0, 0, 0, 0)
Property Value
Remarks
Methods
capture_aabb
Qualifiers: const
Returns the axis-aligned bounding box that contains all the particles that are active in the current frame.
AABB capture_aabb
convert_from_particles(Node)
Sets this node's properties to match a given GPUParticles3D node with an assigned ParticleProcessMaterial.
void convert_from_particles(Node particles)
Parameters
particles
Node
get_param_curve(int)
Qualifiers: const
Returns the Curve of the parameter specified by Parameter.
Curve get_param_curve(int param)
Parameters
param
int
get_param_max(int)
Qualifiers: const
Returns the maximum value range for the given parameter.
float get_param_max(int param)
Parameters
param
int
get_param_min(int)
Qualifiers: const
Returns the minimum value range for the given parameter.
float get_param_min(int param)
Parameters
param
int
get_particle_flag(int)
Qualifiers: const
Returns the enabled state of the given particle flag (see ParticleFlags for options).
bool get_particle_flag(int particle_flag)
Parameters
particle_flag
int
request_particles_process(float)
Requests the particles to process for extra process time during a single frame.
Useful for particle playback, if used in combination with use_fixed_seed or by calling CPUParticles3D.restart with parameter keep_seed
set to true
.
void request_particles_process(float process_time)
Parameters
process_time
float
restart(bool)
Restarts the particle emitter.
If keep_seed
is true
, the current random seed will be preserved. Useful for seeking and playback.
void restart(bool keep_seed)
Parameters
keep_seed
bool
set_param_curve(int, Curve)
void set_param_curve(int param, Curve curve)
Parameters
set_param_max(int, float)
Sets the maximum value for the given parameter.
void set_param_max(int param, float value)
Parameters
set_param_min(int, float)
Sets the minimum value for the given parameter.
void set_param_min(int param, float value)
Parameters
set_particle_flag(int, bool)
Enables or disables the given particle flag (see ParticleFlags for options).
void set_particle_flag(int particle_flag, bool enable)
Parameters
Events
finished
Emitted when all active particles have finished processing. When one_shot is disabled, particles will process continuously, so this is never emitted.
signal finished