ParticlesMaterial

Inherits: Material < Resource < Reference < Object

Particle properties for Particles and Particles2D nodes.

Description

ParticlesMaterial defines particle properties and behavior. It is used in the process_material of Particles and Particles2D emitter nodes.

Some of this material’s properties are applied to each particle when emitted, while others can have a CurveTexture applied to vary values over the lifetime of the particle.

When a randomness ratio is applied to a property it is used to scale that property by a random amount. The random ratio is used to interpolate between 1.0 and a random number less than one, the result is multiplied by the property to obtain the randomized property. For example a random ratio of 0.4 would scale the original property between 0.4-1.0 of its original value.

Properties

floatangle0.0
Textureangle_curve 
floatangle_random0.0
floatangular_velocity0.0
Textureangular_velocity_curve 
floatangular_velocity_random0.0
floatanim_offset0.0
Textureanim_offset_curve 
floatanim_offset_random0.0
floatanim_speed0.0
Textureanim_speed_curve 
floatanim_speed_random0.0
ColorcolorColor( 1, 1, 1, 1 )
Texturecolor_ramp 
floatdamping0.0
Texturedamping_curve 
floatdamping_random0.0
Vector3directionVector3( 1, 0, 0 )
Vector3emission_box_extents 
Textureemission_color_texture 
Textureemission_normal_texture 
intemission_point_count 
Textureemission_point_texture 
EmissionShapeemission_shape0
floatemission_sphere_radius 
boolflag_align_yfalse
boolflag_disable_zfalse
boolflag_rotate_yfalse
floatflatness0.0
Vector3gravityVector3( 0, -9.8, 0 )
floathue_variation0.0
Texturehue_variation_curve 
floathue_variation_random0.0
floatinitial_velocity0.0
floatinitial_velocity_random0.0
floatlifetime_randomness0.0
floatlinear_accel0.0
Texturelinear_accel_curve 
floatlinear_accel_random0.0
floatorbit_velocity 
Textureorbit_velocity_curve 
floatorbit_velocity_random 
floatradial_accel0.0
Textureradial_accel_curve 
floatradial_accel_random0.0
floatscale1.0
Texturescale_curve 
floatscale_random0.0
floatspread45.0
floattangential_accel0.0
Texturetangential_accel_curve 
floattangential_accel_random0.0
GradientTexturetrail_color_modifier 
inttrail_divisor1
CurveTexturetrail_size_modifier 

Methods

boolget_flag ( Flags flag ) const
floatget_param ( Parameter param ) const
floatget_param_randomness ( Parameter param ) const
Textureget_param_texture ( Parameter param ) const
voidset_flag ( Flags flag, bool enable )
voidset_param ( Parameter param, float value )
voidset_param_randomness ( Parameter param, float randomness )
voidset_param_texture ( Parameter param, Texture texture )

Enumerations

enum Parameter:


enum Flags:


enum EmissionShape:

  • EMISSION_SHAPE_POINT = 0 —- All particles will be emitted from a single point.
  • EMISSION_SHAPE_SPHERE = 1 —- Particles will be emitted in the volume of a sphere.
  • EMISSION_SHAPE_BOX = 2 —- Particles will be emitted in the volume of a box.
  • EMISSION_SHAPE_POINTS = 3 —- Particles will be emitted at a position determined by sampling a random point on the emission_point_texture. Particle color will be modulated by emission_color_texture.
  • EMISSION_SHAPE_DIRECTED_POINTS = 4 —- Particles will be emitted at a position determined by sampling a random point on the emission_point_texture. Particle velocity and rotation will be set based on emission_normal_texture. Particle color will be modulated by emission_color_texture.
  • EMISSION_SHAPE_MAX = 5 —- Represents the size of the EmissionShape enum.

Property Descriptions

Default0.0
Setterset_param(value)
Getterget_param()

Initial rotation applied to each particle, in degrees.

Only applied when flag_disable_z or flag_rotate_y are true or the SpatialMaterial being used to draw the particle is using SpatialMaterial.BILLBOARD_PARTICLES.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s rotation will be animated along this CurveTexture.


Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Rotation randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Initial angular velocity applied to each particle. Sets the speed of rotation of the particle.

Only applied when flag_disable_z or flag_rotate_y are true or the SpatialMaterial being used to draw the particle is using SpatialMaterial.BILLBOARD_PARTICLES.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s angular velocity will vary along this CurveTexture.


  • float angular_velocity_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Angular velocity randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Particle animation offset.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s animation offset will vary along this CurveTexture.


  • float anim_offset_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Animation offset randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Particle animation speed.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s animation speed will vary along this CurveTexture.


Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Animation speed randomness ratio.


DefaultColor( 1, 1, 1, 1 )
Setterset_color(value)
Getterget_color()

Each particle’s initial color. If the Particles2D‘s texture is defined, it will be multiplied by this color. To have particle display color in a SpatialMaterial make sure to set SpatialMaterial.vertex_color_use_as_albedo to true.


Setterset_color_ramp(value)
Getterget_color_ramp()

Each particle’s color will vary along this GradientTexture.


Default0.0
Setterset_param(value)
Getterget_param()

The rate at which particles lose velocity.


Setterset_param_texture(value)
Getterget_param_texture()

Damping will vary along this CurveTexture.


Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Damping randomness ratio.


DefaultVector3( 1, 0, 0 )
Setterset_direction(value)
Getterget_direction()

Unit vector specifying the particles’ emission direction.


Setterset_emission_box_extents(value)
Getterget_emission_box_extents()

The box’s extents if emission_shape is set to EMISSION_SHAPE_BOX.


Setterset_emission_color_texture(value)
Getterget_emission_color_texture()

Particle color will be modulated by color determined by sampling this texture at the same point as the emission_point_texture.


Setterset_emission_normal_texture(value)
Getterget_emission_normal_texture()

Particle velocity and rotation will be set by sampling this texture at the same point as the emission_point_texture. Used only in EMISSION_SHAPE_DIRECTED_POINTS. Can be created automatically from mesh or node by selecting “Create Emission Points from Mesh/Node” under the “Particles” tool in the toolbar.


  • int emission_point_count
Setterset_emission_point_count(value)
Getterget_emission_point_count()

The number of emission points if emission_shape is set to EMISSION_SHAPE_POINTS or EMISSION_SHAPE_DIRECTED_POINTS.


Setterset_emission_point_texture(value)
Getterget_emission_point_texture()

Particles will be emitted at positions determined by sampling this texture at a random position. Used with EMISSION_SHAPE_POINTS and EMISSION_SHAPE_DIRECTED_POINTS. Can be created automatically from mesh or node by selecting “Create Emission Points from Mesh/Node” under the “Particles” tool in the toolbar.


Default0
Setterset_emission_shape(value)
Getterget_emission_shape()

Particles will be emitted inside this region. Use EmissionShape constants for values.


  • float emission_sphere_radius
Setterset_emission_sphere_radius(value)
Getterget_emission_sphere_radius()

The sphere’s radius if emission_shape is set to EMISSION_SHAPE_SPHERE.


Defaultfalse
Setterset_flag(value)
Getterget_flag()

Align Y axis of particle with the direction of its velocity.


  • bool flag_disable_z
Defaultfalse
Setterset_flag(value)
Getterget_flag()

If true, particles will not move on the z axis.


Defaultfalse
Setterset_flag(value)
Getterget_flag()

If true, particles rotate around Y axis by angle.


Default0.0
Setterset_flatness(value)
Getterget_flatness()

Amount of spread in Y/Z plane. A value of 1 restricts particles to X/Z plane.


DefaultVector3( 0, -9.8, 0 )
Setterset_gravity(value)
Getterget_gravity()

Gravity applied to every particle.


Default0.0
Setterset_param(value)
Getterget_param()

Initial hue variation applied to each particle.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s hue will vary along this CurveTexture.


  • float hue_variation_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Hue variation randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Initial velocity magnitude for each particle. Direction comes from spread and the node’s orientation.


  • float initial_velocity_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Initial velocity randomness ratio.


  • float lifetime_randomness
Default0.0
Setterset_lifetime_randomness(value)
Getterget_lifetime_randomness()

Particle lifetime randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Linear acceleration applied to each particle in the direction of motion.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s linear acceleration will vary along this CurveTexture.


  • float linear_accel_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Linear acceleration randomness ratio.


Setterset_param(value)
Getterget_param()

Orbital velocity applied to each particle. Makes the particles circle around origin. Specified in number of full rotations around origin per second.

Only available when flag_disable_z is true.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s orbital velocity will vary along this CurveTexture.


  • float orbit_velocity_random
Setterset_param_randomness(value)
Getterget_param_randomness()

Orbital velocity randomness ratio.


Default0.0
Setterset_param(value)
Getterget_param()

Radial acceleration applied to each particle. Makes particle accelerate away from origin.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s radial acceleration will vary along this CurveTexture.


  • float radial_accel_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Radial acceleration randomness ratio.


Default1.0
Setterset_param(value)
Getterget_param()

Initial scale applied to each particle.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s scale will vary along this CurveTexture.


Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Scale randomness ratio.


Default45.0
Setterset_spread(value)
Getterget_spread()

Each particle’s initial direction range from +spread to -spread degrees. Applied to X/Z plane and Y/Z planes.


Default0.0
Setterset_param(value)
Getterget_param()

Tangential acceleration applied to each particle. Tangential acceleration is perpendicular to the particle’s velocity giving the particles a swirling motion.


Setterset_param_texture(value)
Getterget_param_texture()

Each particle’s tangential acceleration will vary along this CurveTexture.


  • float tangential_accel_random
Default0.0
Setterset_param_randomness(value)
Getterget_param_randomness()

Tangential acceleration randomness ratio.


Setterset_trail_color_modifier(value)
Getterget_trail_color_modifier()

Trail particles’ color will vary along this GradientTexture.


  • int trail_divisor
Default1
Setterset_trail_divisor(value)
Getterget_trail_divisor()

Emitter will emit amount divided by trail_divisor particles. The remaining particles will be used as trail(s).


Setterset_trail_size_modifier(value)
Getterget_trail_size_modifier()

Trail particles’ size will vary along this CurveTexture.

Method Descriptions

Returns true if the specified flag is enabled.


Returns the value of the specified parameter.


Returns the randomness ratio associated with the specified parameter.


Returns the Texture used by the specified parameter.


If true, enables the specified flag. See Flags for options.


Sets the specified Parameter.


Sets the randomness ratio for the specified Parameter.


Sets the Texture for the specified Parameter.