Table of Contents

Class CpuParticles3D

Namespace
Godot
Assembly
GodotSharp.dll

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.

[GodotClassName("CPUParticles3D")]
public class CpuParticles3D : GeometryInstance3D, IDisposable
Inheritance
CpuParticles3D
Implements
Inherited Members

Constructors

CpuParticles3D()

public CpuParticles3D()

Properties

Amount

Number of particles emitted in one emission cycle.

public int Amount { get; set; }

Property Value

int

AngleCurve

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

public Curve AngleCurve { get; set; }

Property Value

Curve

AngleMax

Maximum angle.

public float AngleMax { get; set; }

Property Value

float

AngleMin

Minimum angle.

public float AngleMin { get; set; }

Property Value

float

AngularVelocityCurve

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

public Curve AngularVelocityCurve { get; set; }

Property Value

Curve

AngularVelocityMax

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

public float AngularVelocityMax { get; set; }

Property Value

float

AngularVelocityMin

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

public float AngularVelocityMin { get; set; }

Property Value

float

AnimOffsetCurve

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

public Curve AnimOffsetCurve { get; set; }

Property Value

Curve

AnimOffsetMax

Maximum animation offset.

public float AnimOffsetMax { get; set; }

Property Value

float

AnimOffsetMin

Minimum animation offset.

public float AnimOffsetMin { get; set; }

Property Value

float

AnimSpeedCurve

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

public Curve AnimSpeedCurve { get; set; }

Property Value

Curve

AnimSpeedMax

Maximum particle animation speed.

public float AnimSpeedMax { get; set; }

Property Value

float

AnimSpeedMin

Minimum particle animation speed.

public float AnimSpeedMin { get; set; }

Property Value

float

Color

Each particle's initial 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 Gradient ColorInitialRamp { get; set; }

Property Value

Gradient

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 Gradient ColorRamp { get; set; }

Property Value

Gradient

DampingCurve

Damping will vary along this Curve.

public Curve DampingCurve { get; set; }

Property Value

Curve

DampingMax

Maximum damping.

public float DampingMax { get; set; }

Property Value

float

DampingMin

Minimum damping.

public float DampingMin { get; set; }

Property Value

float

Direction

Unit vector specifying the particles' emission direction.

public Vector3 Direction { get; set; }

Property Value

Vector3

DrawOrder

Particle draw order. Uses CpuParticles3D.DrawOrderEnum values.

public CpuParticles3D.DrawOrderEnum DrawOrder { get; set; }

Property Value

CpuParticles3D.DrawOrderEnum

EmissionBoxExtents

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

public Vector3 EmissionBoxExtents { get; set; }

Property Value

Vector3

EmissionColors

Sets the Colors to modulate particles by when using Points or DirectedPoints.

Note: EmissionColors 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, EmissionColors will have no visible effect.

public Color[] EmissionColors { get; set; }

Property Value

Color[]

EmissionNormals

Sets the direction the particles will be emitted in when using DirectedPoints.

public Vector3[] EmissionNormals { get; set; }

Property Value

Vector3[]

EmissionPoints

Sets the initial positions to spawn particles when using Points or DirectedPoints.

public Vector3[] EmissionPoints { get; set; }

Property Value

Vector3[]

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. See CpuParticles3D.EmissionShapeEnum for possible values.

public CpuParticles3D.EmissionShapeEnum EmissionShape { get; set; }

Property Value

CpuParticles3D.EmissionShapeEnum

EmissionSphereRadius

The sphere's radius if CpuParticles3D.EmissionShapeEnum is set to Sphere.

public float EmissionSphereRadius { get; set; }

Property Value

float

Emitting

If true, particles are being emitted. Emitting can be used to start and stop particles from emitting. However, if OneShot 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.

public bool Emitting { get; set; }

Property Value

bool

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.

public float Explosiveness { get; set; }

Property Value

float

FixedFps

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.

public int FixedFps { get; set; }

Property Value

int

Flatness

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

public float Flatness { get; set; }

Property Value

float

FractDelta

If true, results in fractional delta calculation which has a smoother particles display effect.

public bool FractDelta { get; set; }

Property Value

bool

Gravity

Gravity applied to every particle.

public Vector3 Gravity { get; set; }

Property Value

Vector3

HueVariationCurve

Each particle's hue will vary along this Curve.

public Curve HueVariationCurve { get; set; }

Property Value

Curve

HueVariationMax

Maximum hue variation.

public float HueVariationMax { get; set; }

Property Value

float

HueVariationMin

Minimum hue variation.

public float HueVariationMin { get; set; }

Property Value

float

InitialVelocityMax

Maximum value of the initial velocity.

public float InitialVelocityMax { get; set; }

Property Value

float

InitialVelocityMin

Minimum value of the initial velocity.

public float InitialVelocityMin { get; set; }

Property Value

float

Lifetime

Amount of time each particle will exist.

public double Lifetime { get; set; }

Property Value

double

LifetimeRandomness

Particle lifetime randomness ratio.

public double LifetimeRandomness { get; set; }

Property Value

double

LinearAccelCurve

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

public Curve LinearAccelCurve { get; set; }

Property Value

Curve

LinearAccelMax

Maximum linear acceleration.

public float LinearAccelMax { get; set; }

Property Value

float

LinearAccelMin

Minimum linear acceleration.

public float LinearAccelMin { get; set; }

Property Value

float

LocalCoords

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.

public bool LocalCoords { get; set; }

Property Value

bool

Mesh

The Mesh used for each particle. If null, particles will be spheres.

public Mesh Mesh { get; set; }

Property Value

Mesh

OneShot

If true, only one emission cycle occurs. If set true during a cycle, emission will stop at the cycle's end.

public bool OneShot { get; set; }

Property Value

bool

OrbitVelocityCurve

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

public Curve OrbitVelocityCurve { get; set; }

Property Value

Curve

OrbitVelocityMax

Maximum orbit velocity.

public float OrbitVelocityMax { get; set; }

Property Value

float

OrbitVelocityMin

Minimum orbit velocity.

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

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

Preprocess

Particle system starts as if it had already run for this many seconds.

public double Preprocess { get; set; }

Property Value

double

RadialAccelCurve

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

public Curve RadialAccelCurve { get; set; }

Property Value

Curve

RadialAccelMax

Maximum radial acceleration.

public float RadialAccelMax { get; set; }

Property Value

float

RadialAccelMin

Minimum radial acceleration.

public float RadialAccelMin { get; set; }

Property Value

float

Randomness

Emission lifetime randomness ratio.

public float Randomness { get; set; }

Property Value

float

ScaleAmountCurve

Each particle's scale will vary along this Curve.

public Curve ScaleAmountCurve { get; set; }

Property Value

Curve

ScaleAmountMax

Maximum scale.

public float ScaleAmountMax { get; set; }

Property Value

float

ScaleAmountMin

Minimum scale.

public float ScaleAmountMin { get; set; }

Property Value

float

ScaleCurveX

Curve for the scale over life, along the x axis.

public Curve ScaleCurveX { get; set; }

Property Value

Curve

ScaleCurveY

Curve for the scale over life, along the y axis.

public Curve ScaleCurveY { get; set; }

Property Value

Curve

ScaleCurveZ

Curve for the scale over life, along the z axis.

public Curve ScaleCurveZ { get; set; }

Property Value

Curve

SpeedScale

Particle system's running speed scaling ratio. A value of 0 can be used to pause the particles.

public double SpeedScale { get; set; }

Property Value

double

SplitScale

If set to true, three different scale curves can be specified, one per scale axis.

public bool SplitScale { get; set; }

Property Value

bool

Spread

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

public float Spread { get; set; }

Property Value

float

TangentialAccelCurve

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

public Curve TangentialAccelCurve { get; set; }

Property Value

Curve

TangentialAccelMax

Maximum tangent acceleration.

public float TangentialAccelMax { get; set; }

Property Value

float

TangentialAccelMin

Minimum tangent acceleration.

public float TangentialAccelMin { get; set; }

Property Value

float

Methods

ConvertFromParticles(Node)

Sets this node's properties to match a given GpuParticles3D node with an assigned ParticleProcessMaterial.

public void ConvertFromParticles(Node particles)

Parameters

particles Node

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

Restart()

Restarts the particle emitter.

public void Restart()

Events

Finished

Emitted when all active particles have finished processing. When OneShot is disabled, particles will process continuously, so this is never emitted.

public event Action Finished

Event Type

Action