Particle properties for Particles and Particles2D nodes.
    public class ParticlesMaterial : Material

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.

Inheritance Chain

Constructors

    public ParticlesMaterial()

Properties

    public float Angle { get; set; }

Initial rotation applied to each particle, in degrees.

Only applied when FlagDisableZ or FlagRotateY are true or the SpatialMaterial being used to draw the particle is using BillboardMode.BILLBOARD_PARTICLES.

    public Texture AngleCurve { get; set; }

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

    public float AngleRandom { get; set; }

Rotation randomness ratio. Default value: 0.

    public float AngularVelocity { get; set; }

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

Only applied when FlagDisableZ or FlagRotateY are true or the SpatialMaterial being used to draw the particle is using BillboardMode.BILLBOARD_PARTICLES.

    public Texture AngularVelocityCurve { get; set; }

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

    public float AngularVelocityRandom { get; set; }

Angular velocity randomness ratio. Default value: 0.

    public float AnimOffset { get; set; }

Particle animation offset.

    public Texture AnimOffsetCurve { get; set; }

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

    public float AnimOffsetRandom { get; set; }

Animation offset randomness ratio. Default value: 0.

    public float AnimSpeed { get; set; }

Particle animation speed.

    public Texture AnimSpeedCurve { get; set; }

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

    public float AnimSpeedRandom { get; set; }

Animation speed randomness ratio. Default value: 0.

    public Color Color { get; set; }

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.VertexColorUseAsAlbedo to true.

    public Texture ColorRamp { get; set; }

Each particle’s color will vary along this GradientTexture.

    public float Damping { get; set; }

The rate at which particles lose velocity.

    public Texture DampingCurve { get; set; }

Damping will vary along this CurveTexture.

    public float DampingRandom { get; set; }

Damping randomness ratio. Default value: 0.

    public Vector3 EmissionBoxExtents { get; set; }

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

    public Texture EmissionColorTexture { get; set; }

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

    public Texture EmissionNormalTexture { get; set; }

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

    public int EmissionPointCount { get; set; }

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

    public Texture EmissionPointTexture { get; set; }

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.

    public EmissionShapeEnum EmissionShape { get; set; }

Particles will be emitted inside this region. Use EMISSION_SHAPE_* constants for values. Default value: EMISSION_SHAPE_POINT.

    public float EmissionSphereRadius { get; set; }

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

    public bool FlagAlignY { get; set; }

Align y-axis of particle with the direction of its velocity.

    public bool FlagDisableZ { get; set; }

If true, particles will not move on the z axis. Default value: true for Particles2D, false for Particles.

    public bool FlagRotateY { get; set; }

If true, particles rotate around y-axis by Angle.

    public float Flatness { get; set; }

Amount of Spread in Y/Z plane. A value of 1 restricts particles to X/Z plane. Default 0.

    public Vector3 Gravity { get; set; }

Gravity applied to every particle. Default value: (0, 98, 0).

    public float HueVariation { get; set; }

Initial hue variation applied to each particle.

    public Texture HueVariationCurve { get; set; }

Each particle’s hue will vary along this CurveTexture.

    public float HueVariationRandom { get; set; }

Hue variation randomness ratio. Default value: 0.

    public float InitialVelocity { get; set; }

Initial velocity magnitude for each particle. Direction comes from Spread.

    public float InitialVelocityRandom { get; set; }

Initial velocity randomness ratio. Default value: 0.

    public float LinearAccel { get; set; }

Linear acceleration applied to each particle. Acceleration increases velocity magnitude each frame without affecting direction.

    public Texture LinearAccelCurve { get; set; }

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

    public float LinearAccelRandom { get; set; }

Linear acceleration randomness ratio. Default value: 0.

    public float OrbitVelocity { get; set; }

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 FlagDisableZ is true.

    public Texture OrbitVelocityCurve { get; set; }

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

    public float OrbitVelocityRandom { get; set; }

Orbital velocity randomness ratio. Default value: 0.

    public float RadialAccel { get; set; }

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

    public Texture RadialAccelCurve { get; set; }

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

    public float RadialAccelRandom { get; set; }

Radial acceleration randomness ratio. Default value: 0.

    public float Scale { get; set; }

Initial scale applied to each particle.

    public Texture ScaleCurve { get; set; }

Each particle’s scale will vary along this CurveTexture.

    public float ScaleRandom { get; set; }

Scale randomness ratio. Default value: 0.

    public float Spread { get; set; }

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

    public float TangentialAccel { get; set; }

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

    public Texture TangentialAccelCurve { get; set; }

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

    public float TangentialAccelRandom { get; set; }

Tangential acceleration randomness ratio. Default value: 0.

    public GradientTexture TrailColorModifier { get; set; }

Trail particles’ color will vary along this GradientTexture.

    public int TrailDivisor { get; set; }

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

    public CurveTexture TrailSizeModifier { get; set; }

Trail particles’ size will vary along this CurveTexture.

Methods

    public Color GetColor()

Getter for Color

    public Texture GetColorRamp()

Getter for ColorRamp

    public Vector3 GetEmissionBoxExtents()

Getter for EmissionBoxExtents

    public Texture GetEmissionColorTexture()

Getter for EmissionColorTexture

    public Texture GetEmissionNormalTexture()

Getter for EmissionNormalTexture

    public int GetEmissionPointCount()

Getter for EmissionPointCount

    public Texture GetEmissionPointTexture()

Getter for EmissionPointTexture

    public EmissionShapeEnum GetEmissionShape()

Getter for EmissionShape

    public float GetEmissionSphereRadius()

Getter for EmissionSphereRadius

    public bool GetFlag(Flags flag)

    public float GetFlatness()

Getter for Flatness

    public Vector3 GetGravity()

Getter for Gravity

    public float GetParam(Parameter param)

    public float GetParamRandomness(Parameter param)

    public Texture GetParamTexture(Parameter param)

    public float GetSpread()

Getter for Spread

    public GradientTexture GetTrailColorModifier()

Getter for TrailColorModifier

    public int GetTrailDivisor()

Getter for TrailDivisor

    public CurveTexture GetTrailSizeModifier()

Getter for TrailSizeModifier

    public void SetColor(Color color)

Setter for Color

    public void SetColorRamp(Texture ramp)

Setter for ColorRamp

    public void SetEmissionBoxExtents(Vector3 extents)

Setter for EmissionBoxExtents

    public void SetEmissionColorTexture(Texture texture)

Setter for EmissionColorTexture

    public void SetEmissionNormalTexture(Texture texture)

Setter for EmissionNormalTexture

    public void SetEmissionPointCount(int pointCount)

Setter for EmissionPointCount

    public void SetEmissionPointTexture(Texture texture)

Setter for EmissionPointTexture

    public void SetEmissionShape(EmissionShapeEnum shape)

Setter for EmissionShape

    public void SetEmissionSphereRadius(float radius)

Setter for EmissionSphereRadius

    public void SetFlag(Flags flag, bool enable)

    public void SetFlatness(float amount)

Setter for Flatness

    public void SetGravity(Vector3 accelVec)

Setter for Gravity

    public void SetParam(Parameter param, float value)

    public void SetParamRandomness(Parameter param, float randomness)

    public void SetParamTexture(Parameter param, Texture texture)

    public void SetSpread(float degrees)

Setter for Spread

    public void SetTrailColorModifier(GradientTexture texture)

Setter for TrailColorModifier

    public void SetTrailDivisor(int divisor)

Setter for TrailDivisor

    public void SetTrailSizeModifier(CurveTexture texture)

Setter for TrailSizeModifier

Inner Types

EmissionShapeEnum

Name Value Description
Point 0 All particles will be emitted from a single point.
Sphere 1 Particles will be emitted in the volume of a sphere.
Box 2 Particles will be emitted in the volume of a box.
Points 3 Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle color will be modulated by [member emission_color_texture].
DirectedPoints 4 Particles will be emitted at a position determined by sampling a random point on the [member emission_point_texture]. Particle velocity and rotation will be set based on [member emission_normal_texture]. Particle color will be modulated by [member emission_color_texture].

Flags

Name Value Description
AlignYToVelocity 0 Use with [method set_flag] to set [member flag_align_y].
RotateY 1 Use with [method set_flag] to set [member flag_rotate_y]
Max 3  

Parameter

Name Value Description
InitialLinearVelocity 0 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set initial velocity properties.
AngularVelocity 1 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angular velocity properties.
OrbitVelocity 2 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set orbital_velocity properties.
LinearAccel 3 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set linear acceleration properties.
RadialAccel 4 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set radial acceleration properties.
TangentialAccel 5 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set tangential acceleration properties.
Damping 6 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set damping properties.
Angle 7 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set angle properties.
Scale 8 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set scale properties.
HueVariation 9 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set hue_variation properties.
AnimSpeed 10 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation speed properties.
AnimOffset 11 Use with [method set_param], [method set_param_randomness], and [method set_param_texture] to set animation offset properties.
Max 12  
Tags: