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
AngleCurve
Each particle's rotation will be animated along this CurveTexture.
public Texture2D AngleCurve { get; set; }
Property Value
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
AngleMin
Minimum equivalent of AngleMax.
public float AngleMin { get; set; }
Property Value
AngularVelocityCurve
Each particle's angular velocity (rotation speed) will vary along this CurveTexture over its lifetime.
public Texture2D AngularVelocityCurve { get; set; }
Property Value
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
AngularVelocityMin
Minimum equivalent of AngularVelocityMax.
public float AngularVelocityMin { get; set; }
Property Value
AnimOffsetCurve
Each particle's animation offset will vary along this CurveTexture.
public Texture2D AnimOffsetCurve { get; set; }
Property Value
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
AnimOffsetMin
Minimum equivalent of AnimOffsetMax.
public float AnimOffsetMin { get; set; }
Property Value
AnimSpeedCurve
Each particle's animation speed will vary along this CurveTexture.
public Texture2D AnimSpeedCurve { get; set; }
Property Value
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
AnimSpeedMin
Minimum equivalent of AnimSpeedMax.
public float AnimSpeedMin { get; set; }
Property Value
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
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
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
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
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
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
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
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
DampingCurve
Damping will vary along this CurveTexture.
public Texture2D DampingCurve { get; set; }
Property Value
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
DampingMin
Minimum equivalent of DampingMax.
public float DampingMin { get; set; }
Property Value
Direction
Unit vector specifying the particles' emission direction.
public Vector3 Direction { get; set; }
Property Value
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
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
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
EmissionBoxExtents
The box's extents if EmissionShape is set to Box.
public Vector3 EmissionBoxExtents { get; set; }
Property Value
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
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
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
EmissionPointCount
The number of emission points if EmissionShape is set to Points or DirectedPoints.
public int EmissionPointCount { get; set; }
Property Value
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
EmissionRingAxis
The axis of the ring when using the emitter Ring.
public Vector3 EmissionRingAxis { get; set; }
Property Value
EmissionRingHeight
The height of the ring when using the emitter Ring.
public float EmissionRingHeight { get; set; }
Property Value
EmissionRingInnerRadius
The inner radius of the ring when using the emitter Ring.
public float EmissionRingInnerRadius { get; set; }
Property Value
EmissionRingRadius
The radius of the ring when using the emitter Ring.
public float EmissionRingRadius { get; set; }
Property Value
EmissionShape
Particles will be emitted inside this region. Use ParticleProcessMaterial.EmissionShapeEnum constants for values.
public ParticleProcessMaterial.EmissionShapeEnum EmissionShape { get; set; }
Property Value
EmissionShapeOffset
The offset for the EmissionShape, in local space.
public Vector3 EmissionShapeOffset { get; set; }
Property Value
EmissionShapeScale
The scale of the EmissionShape, in local space.
public Vector3 EmissionShapeScale { get; set; }
Property Value
EmissionSphereRadius
The sphere's radius if EmissionShape is set to Sphere.
public float EmissionSphereRadius { get; set; }
Property Value
Flatness
Amount of Spread along the Y axis.
public float Flatness { get; set; }
Property Value
Gravity
Gravity applied to every particle.
public Vector3 Gravity { get; set; }
Property Value
HueVariationCurve
Each particle's hue will vary along this CurveTexture.
public Texture2D HueVariationCurve { get; set; }
Property Value
HueVariationMax
Maximum initial hue variation applied to each particle. It will shift the particle color's hue.
public float HueVariationMax { get; set; }
Property Value
HueVariationMin
Minimum equivalent of HueVariationMax.
public float HueVariationMin { get; set; }
Property Value
InheritVelocityRatio
Percentage of the velocity of the respective GpuParticles2D or GpuParticles3D inherited by each particle when spawning.
public double InheritVelocityRatio { get; set; }
Property Value
InitialVelocityMax
public float InitialVelocityMax { get; set; }
Property Value
InitialVelocityMin
Minimum equivalent of InitialVelocityMax.
public float InitialVelocityMin { get; set; }
Property Value
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
LinearAccelCurve
Each particle's linear acceleration will vary along this CurveTexture.
public Texture2D LinearAccelCurve { get; set; }
Property Value
LinearAccelMax
Maximum linear acceleration applied to each particle in the direction of motion.
public float LinearAccelMax { get; set; }
Property Value
LinearAccelMin
Minimum equivalent of LinearAccelMax.
public float LinearAccelMin { get; set; }
Property Value
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
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
OrbitVelocityMin
Minimum equivalent of OrbitVelocityMax.
Note: Animated velocities will not be affected by damping, use VelocityLimitCurve instead.
public float OrbitVelocityMin { get; set; }
Property Value
ParticleFlagAlignY
Align Y axis of particle with the direction of its velocity.
public bool ParticleFlagAlignY { get; set; }
Property Value
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
ParticleFlagDisableZ
If true
, particles will not move on the z axis.
public bool ParticleFlagDisableZ { get; set; }
Property Value
ParticleFlagRotateY
If true
, particles rotate around Y axis by AngleMin.
public bool ParticleFlagRotateY { get; set; }
Property Value
RadialAccelCurve
Each particle's radial acceleration will vary along this CurveTexture.
public Texture2D RadialAccelCurve { get; set; }
Property Value
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
RadialAccelMin
Minimum equivalent of RadialAccelMax.
public float RadialAccelMin { get; set; }
Property Value
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
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
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
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
ScaleMax
Maximum initial scale applied to each particle.
public float ScaleMax { get; set; }
Property Value
ScaleMin
Minimum equivalent of ScaleMax.
public float ScaleMin { get; set; }
Property Value
ScaleOverVelocityCurve
Either a CurveTexture or a CurveXyzTexture that scales each particle based on its velocity.
public Texture2D ScaleOverVelocityCurve { get; set; }
Property Value
ScaleOverVelocityMax
Maximum velocity value reference for ScaleOverVelocityCurve.
ScaleOverVelocityCurve will be interpolated between ScaleOverVelocityMin and ScaleOverVelocityMax.
public float ScaleOverVelocityMax { get; set; }
Property Value
ScaleOverVelocityMin
Minimum velocity value reference for ScaleOverVelocityCurve.
ScaleOverVelocityCurve will be interpolated between ScaleOverVelocityMin and ScaleOverVelocityMax.
public float ScaleOverVelocityMin { get; set; }
Property Value
Spread
Each particle's initial direction range from +spread
to -spread
degrees.
public float Spread { get; set; }
Property Value
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
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
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
SubEmitterKeepVelocity
If true
, the subemitter inherits the parent particle's velocity when it spawns.
public bool SubEmitterKeepVelocity { get; set; }
Property Value
SubEmitterMode
The particle subemitter mode (see SubEmitter and SubEmitter).
public ParticleProcessMaterial.SubEmitterModeEnum SubEmitterMode { get; set; }
Property Value
TangentialAccelCurve
Each particle's tangential acceleration will vary along this CurveTexture.
public Texture2D TangentialAccelCurve { get; set; }
Property Value
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
TangentialAccelMin
Minimum equivalent of TangentialAccelMax.
public float TangentialAccelMin { get; set; }
Property Value
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
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
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
TurbulenceInfluenceOverLife
Each particle's amount of turbulence will be influenced along this CurveTexture over its life time.
public Texture2D TurbulenceInfluenceOverLife { get; set; }
Property Value
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
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
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
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
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
TurbulenceNoiseStrength
The turbulence noise strength. Increasing this will result in a stronger, more contrasting, flow pattern.
public float TurbulenceNoiseStrength { get; set; }
Property Value
VelocityLimitCurve
A CurveTexture that defines the maximum velocity of a particle during its lifetime.
public Texture2D VelocityLimitCurve { get; set; }
Property Value
VelocityPivot
A pivot point used to calculate radial and orbital velocity of particles.
public Vector3 VelocityPivot { get; set; }
Property Value
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_nameName of the method to check for.
Returns
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_nameName of the signal to check for.
Returns
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_nameName of the method to invoke.
args
NativeVariantPtrArgsArguments to use with the invoked method.
ret
godot_variantValue returned by the invoked method.