Table of Contents

Class ParticleProcessMaterial

Namespace
Godot
Assembly
GodotSharp.dll

ParticleProcessMaterial defines particle properties and behavior. It is used in the process_material of the GpuParticles2D and GpuParticles3D nodes. Some of this material's properties are applied to each particle when emitted, while others can have a CurveTexture or a GradientTexture1D applied to vary numerical or color values over the lifetime of the particle.

public class ParticleProcessMaterial : Material, IDisposable
Inheritance
ParticleProcessMaterial
Implements
Inherited Members

Constructors

ParticleProcessMaterial()

public ParticleProcessMaterial()

Properties

AlphaCurve

The alpha value of each particle's color will be multiplied by this CurveTexture over its lifetime.

public Texture2D AlphaCurve { get; set; }

Property Value

Texture2D

AngleCurve

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

public Texture2D AngleCurve { get; set; }

Property Value

Texture2D

AngleMax

Maximum initial rotation applied to each particle, in degrees.

Only applied when ParticleFlagDisableZ or ParticleFlagRotateY are true or the BaseMaterial3D being used to draw the particle is using Particles.

public float AngleMax { get; set; }

Property Value

float

AngleMin

Minimum equivalent of AngleMax.

public float AngleMin { get; set; }

Property Value

float

AngularVelocityCurve

Each particle's angular velocity (rotation speed) will vary along this CurveTexture over its lifetime.

public Texture2D AngularVelocityCurve { get; set; }

Property Value

Texture2D

AngularVelocityMax

Maximum initial angular velocity (rotation speed) applied to each particle in degrees per second.

Only applied when ParticleFlagDisableZ or ParticleFlagRotateY are true or the BaseMaterial3D being used to draw the particle is using Particles.

public float AngularVelocityMax { get; set; }

Property Value

float

AngularVelocityMin

Minimum equivalent of AngularVelocityMax.

public float AngularVelocityMin { get; set; }

Property Value

float

AnimOffsetCurve

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

public Texture2D AnimOffsetCurve { get; set; }

Property Value

Texture2D

AnimOffsetMax

Maximum animation offset that corresponds to frame index in the texture. 0 is the first frame, 1 is the last one. See ParticlesAnimation.

public float AnimOffsetMax { get; set; }

Property Value

float

AnimOffsetMin

Minimum equivalent of AnimOffsetMax.

public float AnimOffsetMin { get; set; }

Property Value

float

AnimSpeedCurve

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

public Texture2D AnimSpeedCurve { get; set; }

Property Value

Texture2D

AnimSpeedMax

Maximum particle animation speed. Animation speed of 1 means that the particles will make full 0 to 1 offset cycle during lifetime, 2 means 2 cycles etc.

With animation speed greater than 1, remember to enable ParticlesAnimLoop property if you want the animation to repeat.

public float AnimSpeedMax { get; set; }

Property Value

float

AnimSpeedMin

Minimum equivalent of AnimSpeedMax.

public float AnimSpeedMin { get; set; }

Property Value

float

AttractorInteractionEnabled

If true, interaction with particle attractors is enabled. In 3D, attraction only occurs within the area defined by the GpuParticles3D node's VisibilityAabb.

public bool AttractorInteractionEnabled { get; set; }

Property Value

bool

CollisionBounce

The particles' bounciness. Values range from 0 (no bounce) to 1 (full bounciness). Only effective if CollisionMode is Rigid.

public float CollisionBounce { get; set; }

Property Value

float

CollisionFriction

The particles' friction. Values range from 0 (frictionless) to 1 (maximum friction). Only effective if CollisionMode is Rigid.

public float CollisionFriction { get; set; }

Property Value

float

CollisionMode

The particles' collision mode.

Note: 3D Particles can only collide with GpuParticlesCollision3D nodes, not PhysicsBody3D nodes. To make particles collide with various objects, you can add GpuParticlesCollision3D nodes as children of PhysicsBody3D nodes. In 3D, collisions only occur within the area defined by the GpuParticles3D node's VisibilityAabb.

Note: 2D Particles can only collide with LightOccluder2D nodes, not PhysicsBody2D nodes.

public ParticleProcessMaterial.CollisionModeEnum CollisionMode { get; set; }

Property Value

ParticleProcessMaterial.CollisionModeEnum

CollisionUseScale

If true, CollisionBaseSize is multiplied by the particle's effective scale (see ScaleMin, ScaleMax, ScaleCurve, and ScaleOverVelocityCurve).

public bool CollisionUseScale { get; set; }

Property Value

bool

Color

Each particle's initial color. If the GpuParticles2D's texture is defined, it will be multiplied by this color.

Note: Color multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, Color will have no visible effect.

public Color Color { get; set; }

Property Value

Color

ColorInitialRamp

Each particle's initial color will vary along this GradientTexture1D (multiplied with Color).

Note: ColorInitialRamp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, ColorInitialRamp will have no visible effect.

public Texture2D ColorInitialRamp { get; set; }

Property Value

Texture2D

ColorRamp

Each particle's color will vary along this GradientTexture1D over its lifetime (multiplied with Color).

Note: ColorRamp multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, ColorRamp will have no visible effect.

public Texture2D ColorRamp { get; set; }

Property Value

Texture2D

DampingCurve

Damping will vary along this CurveTexture.

public Texture2D DampingCurve { get; set; }

Property Value

Texture2D

DampingMax

The maximum rate at which particles lose velocity. For example value of 100 means that the particle will go from 100 velocity to 0 in 1 second.

public float DampingMax { get; set; }

Property Value

float

DampingMin

Minimum equivalent of DampingMax.

public float DampingMin { get; set; }

Property Value

float

Direction

Unit vector specifying the particles' emission direction.

public Vector3 Direction { get; set; }

Property Value

Vector3

DirectionalVelocityCurve

A curve that specifies the velocity along each of the axes of the particle system along its lifetime.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public Texture2D DirectionalVelocityCurve { get; set; }

Property Value

Texture2D

DirectionalVelocityMax

Maximum directional velocity value, which is multiplied by DirectionalVelocityCurve.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float DirectionalVelocityMax { get; set; }

Property Value

float

DirectionalVelocityMin

Minimum directional velocity value, which is multiplied by DirectionalVelocityCurve.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float DirectionalVelocityMin { get; set; }

Property Value

float

EmissionBoxExtents

The box's extents if EmissionShape is set to Box.

public Vector3 EmissionBoxExtents { get; set; }

Property Value

Vector3

EmissionColorTexture

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

Note: EmissionColorTexture multiplies the particle mesh's vertex colors. To have a visible effect on a BaseMaterial3D, VertexColorUseAsAlbedomust be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function. Otherwise, EmissionColorTexture will have no visible effect.

public Texture2D EmissionColorTexture { get; set; }

Property Value

Texture2D

EmissionCurve

Each particle's color will be multiplied by this CurveTexture over its lifetime.

Note: This property won't have a visible effect unless the render material is marked as unshaded.

public Texture2D EmissionCurve { get; set; }

Property Value

Texture2D

EmissionNormalTexture

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

public Texture2D EmissionNormalTexture { get; set; }

Property Value

Texture2D

EmissionPointCount

The number of emission points if EmissionShape is set to Points or DirectedPoints.

public int EmissionPointCount { get; set; }

Property Value

int

EmissionPointTexture

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

public Texture2D EmissionPointTexture { get; set; }

Property Value

Texture2D

EmissionRingAxis

The axis of the ring when using the emitter Ring.

public Vector3 EmissionRingAxis { get; set; }

Property Value

Vector3

EmissionRingHeight

The height of the ring when using the emitter Ring.

public float EmissionRingHeight { get; set; }

Property Value

float

EmissionRingInnerRadius

The inner radius of the ring when using the emitter Ring.

public float EmissionRingInnerRadius { get; set; }

Property Value

float

EmissionRingRadius

The radius of the ring when using the emitter Ring.

public float EmissionRingRadius { get; set; }

Property Value

float

EmissionShape

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

public ParticleProcessMaterial.EmissionShapeEnum EmissionShape { get; set; }

Property Value

ParticleProcessMaterial.EmissionShapeEnum

EmissionShapeOffset

The offset for the EmissionShape, in local space.

public Vector3 EmissionShapeOffset { get; set; }

Property Value

Vector3

EmissionShapeScale

The scale of the EmissionShape, in local space.

public Vector3 EmissionShapeScale { get; set; }

Property Value

Vector3

EmissionSphereRadius

The sphere's radius if EmissionShape is set to Sphere.

public float EmissionSphereRadius { get; set; }

Property Value

float

Flatness

Amount of Spread along the Y axis.

public float Flatness { get; set; }

Property Value

float

Gravity

Gravity applied to every particle.

public Vector3 Gravity { get; set; }

Property Value

Vector3

HueVariationCurve

Each particle's hue will vary along this CurveTexture.

public Texture2D HueVariationCurve { get; set; }

Property Value

Texture2D

HueVariationMax

Maximum initial hue variation applied to each particle. It will shift the particle color's hue.

public float HueVariationMax { get; set; }

Property Value

float

HueVariationMin

Minimum equivalent of HueVariationMax.

public float HueVariationMin { get; set; }

Property Value

float

InheritVelocityRatio

Percentage of the velocity of the respective GpuParticles2D or GpuParticles3D inherited by each particle when spawning.

public double InheritVelocityRatio { get; set; }

Property Value

double

InitialVelocityMax

Maximum initial velocity magnitude for each particle. Direction comes from Direction and Spread.

public float InitialVelocityMax { get; set; }

Property Value

float

InitialVelocityMin

Minimum equivalent of InitialVelocityMax.

public float InitialVelocityMin { get; set; }

Property Value

float

LifetimeRandomness

Particle lifetime randomness ratio. The equation for the lifetime of a particle is lifetime * (1.0 - randf() * lifetime_randomness). For example, a LifetimeRandomness of 0.4 scales the lifetime between 0.6 to 1.0 of its original value.

public double LifetimeRandomness { get; set; }

Property Value

double

LinearAccelCurve

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

public Texture2D LinearAccelCurve { get; set; }

Property Value

Texture2D

LinearAccelMax

Maximum linear acceleration applied to each particle in the direction of motion.

public float LinearAccelMax { get; set; }

Property Value

float

LinearAccelMin

Minimum equivalent of LinearAccelMax.

public float LinearAccelMin { get; set; }

Property Value

float

OrbitVelocityCurve

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

Note: For 3D orbital velocity, use a CurveXyzTexture.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public Texture2D OrbitVelocityCurve { get; set; }

Property Value

Texture2D

OrbitVelocityMax

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

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float OrbitVelocityMax { get; set; }

Property Value

float

OrbitVelocityMin

Minimum equivalent of OrbitVelocityMax.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float OrbitVelocityMin { get; set; }

Property Value

float

ParticleFlagAlignY

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

public bool ParticleFlagAlignY { get; set; }

Property Value

bool

ParticleFlagDampingAsFriction

Changes the behavior of the damping properties from a linear deceleration to a deceleration based on speed percentage.

public bool ParticleFlagDampingAsFriction { get; set; }

Property Value

bool

ParticleFlagDisableZ

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

public bool ParticleFlagDisableZ { get; set; }

Property Value

bool

ParticleFlagRotateY

If true, particles rotate around Y axis by AngleMin.

public bool ParticleFlagRotateY { get; set; }

Property Value

bool

RadialAccelCurve

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

public Texture2D RadialAccelCurve { get; set; }

Property Value

Texture2D

RadialAccelMax

Maximum radial acceleration applied to each particle. Makes particle accelerate away from the origin or towards it if negative.

public float RadialAccelMax { get; set; }

Property Value

float

RadialAccelMin

Minimum equivalent of RadialAccelMax.

public float RadialAccelMin { get; set; }

Property Value

float

RadialVelocityCurve

A CurveTexture that defines the velocity over the particle's lifetime away (or toward) the VelocityPivot.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public Texture2D RadialVelocityCurve { get; set; }

Property Value

Texture2D

RadialVelocityMax

Maximum radial velocity applied to each particle. Makes particles move away from the VelocityPivot, or toward it if negative.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float RadialVelocityMax { get; set; }

Property Value

float

RadialVelocityMin

Minimum radial velocity applied to each particle. Makes particles move away from the VelocityPivot, or toward it if negative.

Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.

public float RadialVelocityMin { get; set; }

Property Value

float

ScaleCurve

Each particle's scale will vary along this CurveTexture. If a CurveXyzTexture is supplied instead, the scale will be separated per-axis.

public Texture2D ScaleCurve { get; set; }

Property Value

Texture2D

ScaleMax

Maximum initial scale applied to each particle.

public float ScaleMax { get; set; }

Property Value

float

ScaleMin

Minimum equivalent of ScaleMax.

public float ScaleMin { get; set; }

Property Value

float

ScaleOverVelocityCurve

Either a CurveTexture or a CurveXyzTexture that scales each particle based on its velocity.

public Texture2D ScaleOverVelocityCurve { get; set; }

Property Value

Texture2D

ScaleOverVelocityMax

Maximum velocity value reference for ScaleOverVelocityCurve.

ScaleOverVelocityCurve will be interpolated between ScaleOverVelocityMin and ScaleOverVelocityMax.

public float ScaleOverVelocityMax { get; set; }

Property Value

float

ScaleOverVelocityMin

Minimum velocity value reference for ScaleOverVelocityCurve.

ScaleOverVelocityCurve will be interpolated between ScaleOverVelocityMin and ScaleOverVelocityMax.

public float ScaleOverVelocityMin { get; set; }

Property Value

float

Spread

Each particle's initial direction range from +spread to -spread degrees.

public float Spread { get; set; }

Property Value

float

SubEmitterAmountAtCollision

The amount of particles to spawn from the subemitter node when a collision occurs. When combined with HideOnContact on the main particles material, this can be used to achieve effects such as raindrops hitting the ground.

Note: This value shouldn't exceed Amount or Amount defined on the subemitter node (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.

public int SubEmitterAmountAtCollision { get; set; }

Property Value

int

SubEmitterAmountAtEnd

The amount of particles to spawn from the subemitter node when the particle expires.

Note: This value shouldn't exceed Amount or Amount defined on the subemitter node (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.

public int SubEmitterAmountAtEnd { get; set; }

Property Value

int

SubEmitterFrequency

The frequency at which particles should be emitted from the subemitter node. One particle will be spawned every SubEmitterFrequency seconds.

Note: This value shouldn't exceed Amount or Amount defined on the subemitter node (not the main node), relative to the subemitter's particle lifetime. If the number of particles is exceeded, no new particles will spawn from the subemitter until enough particles have expired.

public double SubEmitterFrequency { get; set; }

Property Value

double

SubEmitterKeepVelocity

If true, the subemitter inherits the parent particle's velocity when it spawns.

public bool SubEmitterKeepVelocity { get; set; }

Property Value

bool

SubEmitterMode

The particle subemitter mode (see SubEmitter and SubEmitter).

public ParticleProcessMaterial.SubEmitterModeEnum SubEmitterMode { get; set; }

Property Value

ParticleProcessMaterial.SubEmitterModeEnum

TangentialAccelCurve

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

public Texture2D TangentialAccelCurve { get; set; }

Property Value

Texture2D

TangentialAccelMax

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

public float TangentialAccelMax { get; set; }

Property Value

float

TangentialAccelMin

Minimum equivalent of TangentialAccelMax.

public float TangentialAccelMin { get; set; }

Property Value

float

TurbulenceEnabled

If true, enables turbulence for the particle system. Turbulence can be used to vary particle movement according to its position (based on a 3D noise pattern). In 3D, GpuParticlesAttractorVectorField3D with NoiseTexture3D can be used as an alternative to turbulence that works in world space and with multiple particle systems reacting in the same way.

Note: Enabling turbulence has a high performance cost on the GPU. Only enable turbulence on a few particle systems at once at most, and consider disabling it when targeting mobile/web platforms.

public bool TurbulenceEnabled { get; set; }

Property Value

bool

TurbulenceInfluenceMax

Maximum turbulence influence on each particle.

The actual amount of turbulence influence on each particle is calculated as a random value between TurbulenceInfluenceMin and TurbulenceInfluenceMax and multiplied by the amount of turbulence influence from TurbulenceInfluenceOverLife.

public float TurbulenceInfluenceMax { get; set; }

Property Value

float

TurbulenceInfluenceMin

Minimum turbulence influence on each particle.

The actual amount of turbulence influence on each particle is calculated as a random value between TurbulenceInfluenceMin and TurbulenceInfluenceMax and multiplied by the amount of turbulence influence from TurbulenceInfluenceOverLife.

public float TurbulenceInfluenceMin { get; set; }

Property Value

float

TurbulenceInfluenceOverLife

Each particle's amount of turbulence will be influenced along this CurveTexture over its life time.

public Texture2D TurbulenceInfluenceOverLife { get; set; }

Property Value

Texture2D

TurbulenceInitialDisplacementMax

Maximum displacement of each particle's spawn position by the turbulence.

The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between TurbulenceInitialDisplacementMin and TurbulenceInitialDisplacementMax.

public float TurbulenceInitialDisplacementMax { get; set; }

Property Value

float

TurbulenceInitialDisplacementMin

Minimum displacement of each particle's spawn position by the turbulence.

The actual amount of displacement will be a factor of the underlying turbulence multiplied by a random value between TurbulenceInitialDisplacementMin and TurbulenceInitialDisplacementMax.

public float TurbulenceInitialDisplacementMin { get; set; }

Property Value

float

TurbulenceNoiseScale

This value controls the overall scale/frequency of the turbulence noise pattern.

A small scale will result in smaller features with more detail while a high scale will result in smoother noise with larger features.

public float TurbulenceNoiseScale { get; set; }

Property Value

float

TurbulenceNoiseSpeed

A scrolling velocity for the turbulence field. This sets a directional trend for the pattern to move in over time.

The default value of Vector3(0, 0, 0) turns off the scrolling.

public Vector3 TurbulenceNoiseSpeed { get; set; }

Property Value

Vector3

TurbulenceNoiseSpeedRandom

The in-place rate of change of the turbulence field. This defines how quickly the noise pattern varies over time.

A value of 0.0 will result in a fixed pattern.

public float TurbulenceNoiseSpeedRandom { get; set; }

Property Value

float

TurbulenceNoiseStrength

The turbulence noise strength. Increasing this will result in a stronger, more contrasting, flow pattern.

public float TurbulenceNoiseStrength { get; set; }

Property Value

float

VelocityLimitCurve

A CurveTexture that defines the maximum velocity of a particle during its lifetime.

public Texture2D VelocityLimitCurve { get; set; }

Property Value

Texture2D

VelocityPivot

A pivot point used to calculate radial and orbital velocity of particles.

public Vector3 VelocityPivot { get; set; }

Property Value

Vector3

Methods

HasGodotClassMethod(in godot_string_name)

Check if the type contains a method with the given name. This method is used by Godot to check if a method exists before invoking it. Do not call or override this method.

protected override bool HasGodotClassMethod(in godot_string_name method)

Parameters

method godot_string_name

Name of the method to check for.

Returns

bool

HasGodotClassSignal(in godot_string_name)

Check if the type contains a signal with the given name. This method is used by Godot to check if a signal exists before raising it. Do not call or override this method.

protected override bool HasGodotClassSignal(in godot_string_name signal)

Parameters

signal godot_string_name

Name of the signal to check for.

Returns

bool

InvokeGodotClassMethod(in godot_string_name, NativeVariantPtrArgs, out godot_variant)

Invokes the method with the given name, using the given arguments. This method is used by Godot to invoke methods from the engine side. Do not call or override this method.

protected override bool InvokeGodotClassMethod(in godot_string_name method, NativeVariantPtrArgs args, out godot_variant ret)

Parameters

method godot_string_name

Name of the method to invoke.

args NativeVariantPtrArgs

Arguments to use with the invoked method.

ret godot_variant

Value returned by the invoked method.

Returns

bool