Up to date

This page is up to date for Godot 4.1. If you still find outdated information, please open an issue.

ParticleProcessMaterial

Inherits: Material < Resource < RefCounted < Object

Particle properties for GPUParticles3D and GPUParticles2D nodes.

Description

ParticleProcessMaterial defines particle properties and behavior. It is used in the process_material of GPUParticles3D and GPUParticles2D 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.

Particle animation is available only in GPUParticles2D. To use it, attach a CanvasItemMaterial, with CanvasItemMaterial.particles_animation enabled, to the particles node.

Properties

Texture2D

angle_curve

float

angle_max

0.0

float

angle_min

0.0

Texture2D

angular_velocity_curve

float

angular_velocity_max

0.0

float

angular_velocity_min

0.0

Texture2D

anim_offset_curve

float

anim_offset_max

0.0

float

anim_offset_min

0.0

Texture2D

anim_speed_curve

float

anim_speed_max

0.0

float

anim_speed_min

0.0

bool

attractor_interaction_enabled

true

float

collision_bounce

float

collision_friction

CollisionMode

collision_mode

0

bool

collision_use_scale

false

Color

color

Color(1, 1, 1, 1)

Texture2D

color_initial_ramp

Texture2D

color_ramp

Texture2D

damping_curve

float

damping_max

0.0

float

damping_min

0.0

Vector3

direction

Vector3(1, 0, 0)

Vector3

emission_box_extents

Texture2D

emission_color_texture

Texture2D

emission_normal_texture

int

emission_point_count

Texture2D

emission_point_texture

Vector3

emission_ring_axis

float

emission_ring_height

float

emission_ring_inner_radius

float

emission_ring_radius

EmissionShape

emission_shape

0

float

emission_sphere_radius

float

flatness

0.0

Vector3

gravity

Vector3(0, -9.8, 0)

Texture2D

hue_variation_curve

float

hue_variation_max

0.0

float

hue_variation_min

0.0

float

initial_velocity_max

0.0

float

initial_velocity_min

0.0

float

lifetime_randomness

0.0

Texture2D

linear_accel_curve

float

linear_accel_max

0.0

float

linear_accel_min

0.0

Texture2D

orbit_velocity_curve

float

orbit_velocity_max

float

orbit_velocity_min

bool

particle_flag_align_y

false

bool

particle_flag_disable_z

false

bool

particle_flag_rotate_y

false

Texture2D

radial_accel_curve

float

radial_accel_max

0.0

float

radial_accel_min

0.0

Texture2D

scale_curve

float

scale_max

1.0

float

scale_min

1.0

float

spread

45.0

int

sub_emitter_amount_at_collision

int

sub_emitter_amount_at_end

float

sub_emitter_frequency

bool

sub_emitter_keep_velocity

false

SubEmitterMode

sub_emitter_mode

0

Texture2D

tangential_accel_curve

float

tangential_accel_max

0.0

float

tangential_accel_min

0.0

bool

turbulence_enabled

false

float

turbulence_influence_max

0.1

float

turbulence_influence_min

0.1

Texture2D

turbulence_influence_over_life

float

turbulence_initial_displacement_max

0.0

float

turbulence_initial_displacement_min

0.0

float

turbulence_noise_scale

9.0

Vector3

turbulence_noise_speed

Vector3(0, 0, 0)

float

turbulence_noise_speed_random

0.2

float

turbulence_noise_strength

1.0

Methods

float

get_param_max ( Parameter param ) const

float

get_param_min ( Parameter param ) const

Texture2D

get_param_texture ( Parameter param ) const

bool

get_particle_flag ( ParticleFlags particle_flag ) const

void

set_param_max ( Parameter param, float value )

void

set_param_min ( Parameter param, float value )

void

set_param_texture ( Parameter param, Texture2D texture )

void

set_particle_flag ( ParticleFlags particle_flag, bool enable )


Enumerations

enum Parameter:

Parameter PARAM_INITIAL_LINEAR_VELOCITY = 0

Use with set_param_min, set_param_max, and set_param_texture to set initial velocity properties.

Parameter PARAM_ANGULAR_VELOCITY = 1

Use with set_param_min, set_param_max, and set_param_texture to set angular velocity properties.

Parameter PARAM_ORBIT_VELOCITY = 2

Use with set_param_min, set_param_max, and set_param_texture to set orbital velocity properties.

Parameter PARAM_LINEAR_ACCEL = 3

Use with set_param_min, set_param_max, and set_param_texture to set linear acceleration properties.

Parameter PARAM_RADIAL_ACCEL = 4

Use with set_param_min, set_param_max, and set_param_texture to set radial acceleration properties.

Parameter PARAM_TANGENTIAL_ACCEL = 5

Use with set_param_min, set_param_max, and set_param_texture to set tangential acceleration properties.

Parameter PARAM_DAMPING = 6

Use with set_param_min, set_param_max, and set_param_texture to set damping properties.

Parameter PARAM_ANGLE = 7

Use with set_param_min, set_param_max, and set_param_texture to set angle properties.

Parameter PARAM_SCALE = 8

Use with set_param_min, set_param_max, and set_param_texture to set scale properties.

Parameter PARAM_HUE_VARIATION = 9

Use with set_param_min, set_param_max, and set_param_texture to set hue variation properties.

Parameter PARAM_ANIM_SPEED = 10

Use with set_param_min, set_param_max, and set_param_texture to set animation speed properties.

Parameter PARAM_ANIM_OFFSET = 11

Use with set_param_min, set_param_max, and set_param_texture to set animation offset properties.

Parameter PARAM_MAX = 15

Represents the size of the Parameter enum.

Parameter PARAM_TURB_VEL_INFLUENCE = 13

Use with set_param_min and set_param_max to set the turbulence minimum und maximum influence on each particles velocity.

Parameter PARAM_TURB_INIT_DISPLACEMENT = 14

Use with set_param_min and set_param_max to set the turbulence minimum and maximum displacement of the particles spawn position.

Parameter PARAM_TURB_INFLUENCE_OVER_LIFE = 12

Use with set_param_texture to set the turbulence influence over the particles life time.


enum ParticleFlags:

ParticleFlags PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0

Use with set_particle_flag to set particle_flag_align_y.

ParticleFlags PARTICLE_FLAG_ROTATE_Y = 1

Use with set_particle_flag to set particle_flag_rotate_y.

ParticleFlags PARTICLE_FLAG_DISABLE_Z = 2

Use with set_particle_flag to set particle_flag_disable_z.

ParticleFlags PARTICLE_FLAG_MAX = 3

Represents the size of the ParticleFlags enum.


enum EmissionShape:

EmissionShape EMISSION_SHAPE_POINT = 0

All particles will be emitted from a single point.

EmissionShape EMISSION_SHAPE_SPHERE = 1

Particles will be emitted in the volume of a sphere.

EmissionShape EMISSION_SHAPE_SPHERE_SURFACE = 2

Particles will be emitted on the surface of a sphere.

EmissionShape EMISSION_SHAPE_BOX = 3

Particles will be emitted in the volume of a box.

EmissionShape EMISSION_SHAPE_POINTS = 4

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.

EmissionShape EMISSION_SHAPE_DIRECTED_POINTS = 5

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.

EmissionShape EMISSION_SHAPE_RING = 6

Particles will be emitted in a ring or cylinder.

EmissionShape EMISSION_SHAPE_MAX = 7

Represents the size of the EmissionShape enum.


enum SubEmitterMode:

SubEmitterMode SUB_EMITTER_DISABLED = 0

SubEmitterMode SUB_EMITTER_CONSTANT = 1

SubEmitterMode SUB_EMITTER_AT_END = 2

SubEmitterMode SUB_EMITTER_AT_COLLISION = 3

SubEmitterMode SUB_EMITTER_MAX = 4

Represents the size of the SubEmitterMode enum.


enum CollisionMode:

CollisionMode COLLISION_DISABLED = 0

No collision for particles. Particles will go through GPUParticlesCollision3D nodes.

CollisionMode COLLISION_RIGID = 1

RigidBody3D-style collision for particles using GPUParticlesCollision3D nodes.

CollisionMode COLLISION_HIDE_ON_CONTACT = 2

Hide particles instantly when colliding with a GPUParticlesCollision3D node. This can be combined with a subemitter that uses the