Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

ParticleProcessMaterial

繼承: Material < Resource < RefCounted < Object

GPUParticles3DGPUParticles2D 節點的粒子屬性。

說明

ParticleProcessMaterial 定義了粒子的屬性和行為。GPUParticles3DGPUParticles2D 發射器節點的 process_material 會使用這個材質。

這種材質的有些屬性是在粒子發射時套用的,有些則會在粒子的生命週期中不斷套用按照 CurveTexture 變化的值。

粒子動畫僅在 GPUParticles2D 中可用。使用時請為粒子節點分配 CanvasItemMaterial 並啟用其 CanvasItemMaterial.particles_animation

屬性

Texture2D

alpha_curve

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)

Texture2D

directional_velocity_curve

float

directional_velocity_max

float

directional_velocity_min

Vector3

emission_box_extents

Texture2D

emission_color_texture

Texture2D

emission_curve

Texture2D

emission_normal_texture

int

emission_point_count

Texture2D

emission_point_texture

Vector3

emission_ring_axis

float

emission_ring_cone_angle

float

emission_ring_height

float

emission_ring_inner_radius

float

emission_ring_radius

EmissionShape

emission_shape

0

Vector3

emission_shape_offset

Vector3(0, 0, 0)

Vector3

emission_shape_scale

Vector3(1, 1, 1)

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

inherit_velocity_ratio

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

0.0

float

orbit_velocity_min

0.0

bool

particle_flag_align_y

false

bool

particle_flag_damping_as_friction

false

bool

particle_flag_disable_z

false

bool

particle_flag_inherit_emitter_scale

false

bool

particle_flag_rotate_y

false

Texture2D

radial_accel_curve

float

radial_accel_max

0.0

float

radial_accel_min

0.0

Texture2D

radial_velocity_curve

float

radial_velocity_max

0.0

float

radial_velocity_min

0.0

Vector3

rotation_3d_max

Vector3

rotation_3d_min

Texture2D

rotation_velocity_3d_curve

Vector3

rotation_velocity_3d_max

Vector3

rotation_velocity_3d_min

Vector3

scale_3d_max

Vector3

scale_3d_min

Texture2D

scale_curve

float

scale_max

1.0

float

scale_min

1.0

Texture2D

scale_over_velocity_curve

float

scale_over_velocity_max

0.0

float

scale_over_velocity_min

0.0

float

spread

45.0

int

sub_emitter_amount_at_collision

int

sub_emitter_amount_at_end

int

sub_emitter_amount_at_start

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

bool

use_rotation_3d

false

bool

use_rotation_velocity_3d

false

bool

use_scale_3d

false

Texture2D

velocity_limit_curve

Vector3

velocity_pivot

Vector3(0, 0, 0)

方法

Vector2

get_param(param: Parameter) const

float

get_param_max(param: Parameter) const

float

get_param_min(param: Parameter) const

Texture2D

get_param_texture(param: Parameter) const

bool

get_particle_flag(particle_flag: ParticleFlags) const

void

set_param(param: Parameter, value: Vector2)

void

set_param_max(param: Parameter, value: float)

void

set_param_min(param: Parameter, value: float)

void

set_param_texture(param: Parameter, texture: Texture2D)

void

set_particle_flag(particle_flag: ParticleFlags, enable: bool)


訊號

emission_shape_changed() 🔗

Emitted when this material's emission shape is changed in any way. This includes changes to emission_shape, emission_shape_scale, or emission_sphere_radius, and any other property that affects the emission shape's offset, size, scale, or orientation.

Note: This signal is only emitted inside the editor for performance reasons.


列舉

enum Parameter: 🔗

Parameter PARAM_INITIAL_LINEAR_VELOCITY = 0

set_param_min()set_param_max()set_param_texture() 一起使用,設定初始速度屬性。

Parameter PARAM_ANGULAR_VELOCITY = 1

set_param_min()set_param_max()set_param_texture() 一起使用,設定角速度屬性。

Parameter PARAM_ORBIT_VELOCITY = 2

set_param_min()set_param_max()set_param_texture() 一起使用,設定軌道速度屬性。

Parameter PARAM_LINEAR_ACCEL = 3

set_param_min()set_param_max()set_param_texture() 一起使用,設定線速度屬性。

Parameter PARAM_RADIAL_ACCEL = 4

set_param_min()set_param_max()set_param_texture() 一起使用,設定徑向加速度屬性。

Parameter PARAM_TANGENTIAL_ACCEL = 5

set_param_min()set_param_max()set_param_texture() 一起使用,設定切向加速度屬性。

Parameter PARAM_DAMPING = 6

set_param_min()set_param_max()set_param_texture() 一起使用,設定阻尼屬性。

Parameter PARAM_ANGLE = 7

set_param_min()set_param_max()set_param_texture() 一起使用,設定角度屬性。

Parameter PARAM_SCALE = 8

set_param_min()set_param_max()set_param_texture() 一起使用,設定縮放屬性。

Parameter PARAM_HUE_VARIATION = 9

set_param_min()set_param_max()set_param_texture() 一起使用,設定色相變化屬性。

Parameter PARAM_ANIM_SPEED = 10

set_param_min()set_param_max()set_param_texture() 一起使用,設定動畫速度屬性。

Parameter PARAM_ANIM_OFFSET = 11

set_param_min()set_param_max()set_param_texture() 一起使用,設定動畫偏移屬性。

Parameter PARAM_RADIAL_VELOCITY = 15

Use with set_param_min(), set_param_max(), and set_param_texture() to set radial velocity properties.

Parameter PARAM_DIRECTIONAL_VELOCITY = 16

Use with set_param_min(), set_param_max(), and set_param_texture() to set directional velocity properties.

Parameter PARAM_SCALE_OVER_VELOCITY = 17

Use with set_param_min(), set_param_max(), and set_param_texture() to set scale over velocity properties.

Parameter PARAM_MAX = 18

代表 Parameter 列舉的大小。

Parameter PARAM_TURB_VEL_INFLUENCE = 13

set_param_min()set_param_max() 一起使用,以設定湍流對每個粒子速度的最小和最大影響。

Parameter PARAM_TURB_INIT_DISPLACEMENT = 14

set_param_min()set_param_max() 一起使用,以設定粒子出生位置的湍流最小和最大位移。

Parameter PARAM_TURB_INFLUENCE_OVER_LIFE = 12

set_param_texture() 一起使用,以設定湍流對粒子壽命的影響。


enum ParticleFlags: 🔗

ParticleFlags PARTICLE_FLAG_ALIGN_Y_TO_VELOCITY = 0

set_particle_flag() 一起使用,設定 particle_flag_align_y

ParticleFlags PARTICLE_FLAG_ROTATE_Y = 1

set_particle_flag() 一起使用,設定 particle_flag_rotate_y

ParticleFlags PARTICLE_FLAG_DISABLE_Z = 2

set_particle_flag() 一起使用,設定particle_flag_disable_z

ParticleFlags PARTICLE_FLAG_DAMPING_AS_FRICTION = 3

There is currently no description for this enum. Please help us by contributing one!

ParticleFlags PARTICLE_FLAG_INHERIT_EMITTER_SCALE = 4

There is currently no description for this enum. Please help us by contributing one!

ParticleFlags PARTICLE_FLAG_MAX = 5

代表 ParticleFlags 列舉的大小。


enum EmissionShape: 🔗

EmissionShape EMISSION_SHAPE_POINT = 0

所有粒子將從單個點發射。

EmissionShape EMISSION_SHAPE_SPHERE = 1

粒子將在球體的體積中發射。

EmissionShape EMISSION_SHAPE_SPHERE_SURFACE = 2

粒子將在球體表面發射。

EmissionShape EMISSION_SHAPE_BOX = 3

粒子將在盒子的體積中發射。

EmissionShape EMISSION_SHAPE_POINTS = 4

粒子將在 emission_point_texture 上隨機取樣點所決定的位置發射。粒子顏色將由 emission_color_texture 調節。

EmissionShape EMISSION_SHAPE_DIRECTED_POINTS = 5

粒子將在 emission_point_texture 上隨機取樣點所決定的位置發射。粒子速度和旋轉將基於 emission_normal_texture 進行設定。粒子顏色將由 emission_color_texture 調節。

EmissionShape EMISSION_SHAPE_RING = 6

粒子將以環形或圓柱的形式發射出來。

EmissionShape EMISSION_SHAPE_MAX = 7

代表 EmissionShape 列舉的大小。


enum SubEmitterMode: 🔗

SubEmitterMode SUB_EMITTER_DISABLED = 0

The subemitter is disabled.

SubEmitterMode SUB_EMITTER_CONSTANT = 1

The submitter is emitted on the constant interval defined by sub_emitter_frequency.

SubEmitterMode SUB_EMITTER_AT_END = 2

The subemitter is emitted at the end of the particle's lifetime.

SubEmitterMode SUB_EMITTER_AT_COLLISION = 3

The subemitter is emitted when the particle collides.

SubEmitterMode SUB_EMITTER_AT_START = 4

The subemitter is emitted when the particle spawns.

SubEmitterMode SUB_EMITTER_MAX = 5

代表 SubEmitterMode 列舉的大小。


enum CollisionMode: 🔗

CollisionMode COLLISION_DISABLED = 0

粒子沒有碰撞。粒子會穿過 GPUParticlesCollision3D 節點。

CollisionMode COLLISION_RIGID = 1

為使用 GPUParticlesCollision3D 節點的粒子設定 RigidBody3D 風格的碰撞。

CollisionMode COLLISION_HIDE_ON_CONTACT = 2

GPUParticlesCollision3D 節點碰撞時立即隱藏粒子。可以和使用 COLLISION_RIGID 碰撞模式的子發射器組合,在撞擊時將父粒子“替換”為子發射器。

CollisionMode COLLISION_MAX = 3

代表 CollisionMode 列舉的大小。


屬性說明

Texture2D alpha_curve 🔗

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

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


Texture2D angle_curve 🔗

每個粒子的旋轉將沿著這個 CurveTexture 動畫。


float angle_max = 0.0 🔗

套用於每個粒子的最大初始旋轉,以度為單位。

僅在 particle_flag_disable_zparticle_flag_rotate_ytrue,或 BaseMaterial3D 使用 BaseMaterial3D.BILLBOARD_PARTICLES 繪製粒子時套用。


float angle_min = 0.0 🔗

angle_max 的對應最小值。


Texture2D angular_velocity_curve 🔗

在每個粒子生命週期內,其角速度(旋轉速度)將沿著此 CurveTexture 變化。


float angular_velocity_max = 0.0 🔗

套用於每個粒子的最大初始角速度(旋轉速度),以每秒為單位。

僅在 particle_flag_disable_zparticle_flag_rotate_ytrue,或 BaseMaterial3D 使用 BaseMaterial3D.BILLBOARD_PARTICLES 繪製粒子時套用。


float angular_velocity_min = 0.0 🔗

angular_velocity_max 的對應最小值。


Texture2D anim_offset_curve 🔗

每個粒子的動畫偏移將沿著這個 CurveTexture 變化。


float anim_offset_max = 0.0 🔗

與紋理中的影格索引相對應的最大動畫偏移量。0 是第一影格,1 是最後一影格。參見 CanvasItemMaterial.particles_animation


float anim_offset_min = 0.0 🔗

anim_offset_max 的對應最小值。


Texture2D anim_speed_curve 🔗

每個粒子的動畫速度將沿著這個 CurveTexture 變化。


float anim_speed_max = 0.0 🔗

最大粒子動畫速度。1 的動畫速度是指粒子在生命週期內會做完整的 01 的偏移迴圈,2 則表示 2 個迴圈,如此等等。

當動畫速度大於 1 時,如果希望動畫重複,請記住啟用 CanvasItemMaterial.particles_anim_loop 屬性。


float anim_speed_min = 0.0 🔗

anim_speed_max 的對應最小值。


bool attractor_interaction_enabled = true 🔗

  • void set_attractor_interaction_enabled(value: bool)

  • bool is_attractor_interaction_enabled()

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


float collision_bounce 🔗

  • void set_collision_bounce(value: float)

  • float get_collision_bounce()

粒子的彈性。值範圍從 0(無彈跳)到 1(完全彈跳)。僅當 collision_modeCOLLISION_RIGID 時有效。


float collision_friction 🔗

  • void set_collision_friction(value: float)

  • float get_collision_friction()

粒子的摩擦。值範圍從 0(無摩擦)到 1(最大摩擦)。


CollisionMode collision_mode = 0 🔗

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 GPUParticles3D.visibility_aabb.

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


bool collision_use_scale = false 🔗

  • void set_collision_use_scale(value: bool)

  • bool is_collision_using_scale()

If true, GPUParticles3D.collision_base_size is multiplied by the particle's effective scale (see scale_min, scale_max, scale_curve, and scale_over_velocity_curve).


Color color = Color(1, 1, 1, 1) 🔗

每個粒子的初始顏色。如果定義了 GPUParticles2Dtexture,它將乘以該顏色。

注意:color 乘以粒子網格的頂點顏色。要在 BaseMaterial3D 上產生可見效果,BaseMaterial3D.vertex_color_use_as_albedo 必須true。對於 ShaderMaterial,必須在著色器的 fragment() 函式中插入 ALBEDO *= COLOR.rgb;。否則,color 將沒有可見效果。


Texture2D color_initial_ramp 🔗

每個粒子的初始顏色將沿著該 GradientTexture1D(乘以 color)而變化。

注意:color_initial_ramp 乘以粒子網格的頂點顏色。要在 BaseMaterial3D 上產生可見效果,BaseMaterial3D.vertex_color_use_as_albedo 必須true。對於 ShaderMaterial,必須在著色器的 fragment() 函式中插入 ALBEDO *= COLOR.rgb;。否則,color_initial_ramp 將沒有可見效果。


Texture2D color_ramp 🔗

每個粒子的顏色將在其生命週期內沿該 GradientTexture1D 變化(乘以 color)。

注意:color_ramp 乘以粒子網格的頂點顏色。要在 BaseMaterial3D 上產生可見效果,BaseMaterial3D.vertex_color_use_as_albedo 必須true。對於 ShaderMaterial,必須在著色器的 fragment() 函式中插入 ALBEDO *= COLOR.rgb;。否則,color_ramp 將沒有可見效果。


Texture2D damping_curve 🔗

阻尼將沿著這個 CurveTexture 變化。


float damping_max = 0.0 🔗

粒子失去速度的最大速率。例如 100 的值表示粒子將在 1 秒內,速度從 100 變為 0


float damping_min = 0.0 🔗

damping_max 的對應最小值。


Vector3 direction = Vector3(1, 0, 0) 🔗

指定粒子發射方向的單位向量。


Texture2D directional_velocity_curve 🔗

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 velocity_limit_curve instead.


float directional_velocity_max 🔗

Maximum directional velocity value, which is multiplied by directional_velocity_curve.

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


float directional_velocity_min 🔗

Minimum directional velocity value, which is multiplied by directional_velocity_curve.

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


Vector3 emission_box_extents 🔗

  • void set_emission_box_extents(value: Vector3)

  • Vector3 get_emission_box_extents()

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

Note: emission_box_extents starts from the center point and applies the X, Y, and Z values in both directions. The size is twice the area of the extents.


Texture2D emission_color_texture 🔗

  • void set_emission_color_texture(value: Texture2D)

  • Texture2D get_emission_color_texture()

粒子顏色將被調變,調變使用的顏色將通過對該紋理在與 emission_point_texture 相同的點處進行取樣來確定。

注意:emission_color_texture 乘以粒子網格的頂點顏色。要在 BaseMaterial3D 上產生可見效果,BaseMaterial3D.vertex_color_use_as_albedo 必須true。對於 ShaderMaterial,必須在著色器的 fragment() 函式中插入 ALBEDO *= COLOR.rgb;。否則,emission_color_texture 將沒有可見效果。


Texture2D emission_curve 🔗

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

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


Texture2D emission_normal_texture 🔗

  • void set_emission_normal_texture(value: Texture2D)

  • Texture2D get_emission_normal_texture()

粒子的速度和旋轉將通過在與emission_point_texture相同的點上對該紋理進行取樣來設定。僅在EMISSION_SHAPE_DIRECTED_POINTS中使用。可以通過選擇工具列中 "粒子 "工具下的 "從網格/節點建立發射點",從網格或節點自動創建。


int emission_point_count 🔗

  • void set_emission_point_count(value: int)

  • int get_emission_point_count()

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


Texture2D emission_point_texture 🔗

  • void set_emission_point_texture(value: Texture2D)

  • Texture2D get_emission_point_texture()

粒子將被發射到由隨機取樣紋理所決定的位置。與EMISSION_SHAPE_POINTSEMISSION_SHAPE_DIRECTED_POINTS一起使用。可以通過選擇工具列中的“粒子”工具下的“從網格/節點中建立發射點”自動建立網格或節點。


Vector3 emission_ring_axis 🔗

  • void set_emission_ring_axis(value: Vector3)

  • Vector3 get_emission_ring_axis()

使用形為 EMISSION_SHAPE_RING 的發射器時環的軸。


float emission_ring_cone_angle 🔗

  • void set_emission_ring_cone_angle(value: float)

  • float get_emission_ring_cone_angle()

The angle of the cone when using the emitter EMISSION_SHAPE_RING. The default angle of 90 degrees results in a ring, while an angle of 0 degrees results in a cone. Intermediate values will result in a ring where one end is larger than the other.

Note: Depending on emission_ring_height, the angle may be clamped if the ring's end is reached to form a perfect cone.


float emission_ring_height 🔗

  • void set_emission_ring_height(value: float)

  • float get_emission_ring_height()

使用形為 EMISSION_SHAPE_RING 的發射器時環的高度。


float emission_ring_inner_radius 🔗

  • void set_emission_ring_inner_radius(value: float)

  • float get_emission_ring_inner_radius()

使用形為 EMISSION_SHAPE_RING 的發射器時環的內半徑。


float emission_ring_radius 🔗

  • void set_emission_ring_radius(value: float)

  • float get_emission_ring_radius()

使用形為 EMISSION_SHAPE_RING 的發射器時環的半徑。


EmissionShape emission_shape = 0 🔗

Particles will be emitted inside this region.


Vector3 emission_shape_offset = Vector3(0, 0, 0) 🔗

  • void set_emission_shape_offset(value: Vector3)

  • Vector3 get_emission_shape_offset()

The offset for the emission_shape, in local space.


Vector3 emission_shape_scale = Vector3(1, 1, 1) 🔗

  • void set_emission_shape_scale(value: Vector3)

  • Vector3 get_emission_shape_scale()

The scale of the emission_shape, in local space.


float emission_sphere_radius 🔗

  • void set_emission_sphere_radius(value: float)

  • float get_emission_sphere_radius()

emission_shape 被設定為 EMISSION_SHAPE_SPHERE 時,該球體的半徑。


float flatness = 0.0 🔗

  • void set_flatness(value: float)

  • float get_flatness()

沿 Y 軸的 spread 量。


Vector3 gravity = Vector3(0, -9.8, 0) 🔗

套用於每個粒子的重力。


Texture2D hue_variation_curve 🔗

每個粒子的色調將沿著這個 CurveTexture 變化。


float hue_variation_max = 0.0 🔗

套用於每個粒子的最大初始色相變化。會改變粒子顏色的色相。


float hue_variation_min = 0.0 🔗

hue_variation_max 的對應最小值。


float inherit_velocity_ratio = 0.0 🔗

  • void set_inherit_velocity_ratio(value: float)

  • float get_inherit_velocity_ratio()

Percentage of the velocity of the respective GPUParticles2D or GPUParticles3D inherited by each particle when spawning.


float initial_velocity_max = 0.0 🔗

每個粒子的最大初始速度大小。方向來自 directionspread


float initial_velocity_min = 0.0 🔗

initial_velocity_max 的對應最小值。


float lifetime_randomness = 0.0 🔗

  • void set_lifetime_randomness(value: float)

  • float get_lifetime_randomness()

粒子壽命隨機比率。粒子壽命的公式為 lifetime * (1.0 - randf() * lifetime_randomness)。例如 lifetime_randomness0.4 時,壽命會被縮放為原本的 0.61.0 倍。


Texture2D linear_accel_curve 🔗

每個粒子的線性加速度將沿著這個 CurveTexture 變化。


float linear_accel_max = 0.0 🔗

在運動方向上套用於每個粒子的最大線性加速度。


float linear_accel_min = 0.0 🔗

linear_accel_max 的對應最小值。


Texture2D orbit_velocity_curve 🔗

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 velocity_limit_curve instead.


float orbit_velocity_max = 0.0 🔗

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 velocity_limit_curve instead.


float orbit_velocity_min = 0.0 🔗

Minimum equivalent of orbit_velocity_max.

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


bool particle_flag_align_y = false 🔗

將粒子的 Y 軸與其速度方向對齊。


bool particle_flag_damping_as_friction = false 🔗

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


bool particle_flag_disable_z = false 🔗

如果為 true,則粒子將不會在 z 軸上移動。


bool particle_flag_inherit_emitter_scale = false 🔗

If true, particles will inherit the scale of the emitter.

Note: This has no effect when GPUParticles3D.local_coords is true, since particles in local space are already affected by the emitter's scale.


bool particle_flag_rotate_y = false 🔗

如果為 true,則粒子繞 Y 軸旋轉 angle_min


Texture2D radial_accel_curve 🔗

每個粒子的徑向加速度將沿著這個 CurveTexture 變化。


float radial_accel_max = 0.0 🔗

套用於每個粒子的最大徑向加速度。使粒子加速遠離原點;或如果為負,則加速靠近原點。


float radial_accel_min = 0.0 🔗

radial_accel_max 的對應最小值。


Texture2D radial_velocity_curve 🔗

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

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


float radial_velocity_max = 0.0 🔗

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

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


float radial_velocity_min = 0.0 🔗

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

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


Vector3 rotation_3d_max 🔗

  • void set_rotation_3d_max(value: Vector3)

  • Vector3 get_rotation_3d_max()

The maximum 3D orientation, in degrees. Works only in 3D and if use_rotation_3d is enabled.


Vector3 rotation_3d_min 🔗

  • void set_rotation_3d_min(value: Vector3)

  • Vector3 get_rotation_3d_min()

The minimum 3D orientation, in degrees. Works only in 3D and if use_rotation_3d is enabled.


Texture2D rotation_velocity_3d_curve 🔗

  • void set_rotation_velocity_3d_curve(value: Texture2D)

  • Texture2D get_rotation_velocity_3d_curve()

Rotation velocity curve over lifetime, per-axis. Enable use_rotation_velocity_3d to use this.


Vector3 rotation_velocity_3d_max 🔗

  • void set_rotation_velocity_3d_max(value: Vector3)

  • Vector3 get_rotation_velocity_3d_max()

Maximum 3D rotation velocity on the particle's local axis. Enable use_rotation_velocity_3d to use this.


Vector3 rotation_velocity_3d_min 🔗

  • void set_rotation_velocity_3d_min(value: Vector3)

  • Vector3 get_rotation_velocity_3d_min()

Minimum 3D rotation velocity on the particle's local axis. Enable use_rotation_velocity_3d to use this.


Vector3 scale_3d_max 🔗

The maximum value of the random scale vector for each particle.

Works only if use_scale_3d is enabled.


Vector3 scale_3d_min 🔗

The minimum value of the random scale vector for each particle.

Works only if use_scale_3d is enabled.


Texture2D scale_curve 🔗

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


float scale_max = 1.0 🔗

套用於每個粒子的最大初始縮放。


float scale_min = 1.0 🔗

scale_max 對應的最小值。


Texture2D scale_over_velocity_curve 🔗

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


float scale_over_velocity_max = 0.0 🔗

Maximum velocity value reference for scale_over_velocity_curve.

scale_over_velocity_curve will be interpolated between scale_over_velocity_min and scale_over_velocity_max.


float scale_over_velocity_min = 0.0 🔗

Minimum velocity value reference for scale_over_velocity_curve.

scale_over_velocity_curve will be interpolated between scale_over_velocity_min and scale_over_velocity_max.


float spread = 45.0 🔗

  • void set_spread(value: float)

  • float get_spread()

每個粒子的初始方向範圍,從 +spread 度到 -spread 度。


int sub_emitter_amount_at_collision 🔗

  • void set_sub_emitter_amount_at_collision(value: int)

  • int get_sub_emitter_amount_at_collision()

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

Note: This value shouldn't exceed GPUParticles2D.amount or GPUParticles3D.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.


int sub_emitter_amount_at_end 🔗

  • void set_sub_emitter_amount_at_end(value: int)

  • int get_sub_emitter_amount_at_end()

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

Note: This value shouldn't exceed GPUParticles2D.amount or GPUParticles3D.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.


int sub_emitter_amount_at_start 🔗

  • void set_sub_emitter_amount_at_start(value: int)

  • int get_sub_emitter_amount_at_start()

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

Note: This value shouldn't exceed GPUParticles2D.amount or GPUParticles3D.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.


float sub_emitter_frequency 🔗

  • void set_sub_emitter_frequency(value: float)

  • float get_sub_emitter_frequency()

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

Note: This value shouldn't exceed GPUParticles2D.amount or GPUParticles3D.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.


bool sub_emitter_keep_velocity = false 🔗

  • void set_sub_emitter_keep_velocity(value: bool)

  • bool get_sub_emitter_keep_velocity()

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


SubEmitterMode sub_emitter_mode = 0 🔗

The particle subemitter mode (see GPUParticles2D.sub_emitter and GPUParticles3D.sub_emitter).


Texture2D tangential_accel_curve 🔗

每個粒子的切向加速度將沿著這個 CurveTexture 變化。


float tangential_accel_max = 0.0 🔗

套用於每個粒子的最大切向加速度。切向加速度垂直於粒子的速度,從而使粒子產生渦旋運動。


float tangential_accel_min = 0.0 🔗

tangential_accel_max 的對應最小值。


bool turbulence_enabled = false 🔗

  • void set_turbulence_enabled(value: bool)

  • bool get_turbulence_enabled()

如果為 true,則為粒子系統啟用湍流。湍流可以(基於 3D 雜訊圖案)根據粒子的位置來改變粒子的移動。在 3D 中,可以用 GPUParticlesAttractorVectorField3DNoiseTexture3D 作為世界空間湍流的平替,能夠讓不同粒子系統作出相同的反應。

注意:啟用湍流對於 GPU 有較高的性能消耗。請最多只對少量粒子系統啟用湍流,以移動/Web 平臺作為目標時請考慮禁用湍流。


float turbulence_influence_max = 0.1 🔗

對每個粒子的最大湍流影響。

對每個粒子的實際湍流影響量,計算為介於 turbulence_influence_minturbulence_influence_max 之間的一個隨機值,並乘以來自 turbulence_influence_over_life 的湍流影響量。


float turbulence_influence_min = 0.1 🔗

對每個粒子的最小湍流影響。

對每個粒子的實際湍流影響量,計算為介於 turbulence_influence_minturbulence_influence_max 之間的一個隨機值,並乘以來自 turbulence_influence_over_life 的湍流影響量。


Texture2D turbulence_influence_over_life 🔗

每個粒子的湍流量,將在其生命週期內沿這條 CurveTexture 受到影響。


float turbulence_initial_displacement_max = 0.0 🔗

湍流對每個粒子出生位置的最大位移。

實際位移量將是基礎湍流乘以一個介於 turbulence_initial_displacement_minturbulence_initial_displacement_max 之間的隨機值的係數。


float turbulence_initial_displacement_min = 0.0 🔗

湍流對每個粒子出生位置的最小位移。

實際位移量將是基礎湍流乘以一個介於 turbulence_initial_displacement_minturbulence_initial_displacement_max 之間的隨機值的係數。


float turbulence_noise_scale = 9.0 🔗

  • void set_turbulence_noise_scale(value: float)

  • float get_turbulence_noise_scale()

該值控制湍流雜訊圖案的整體比例/頻率。

小的比例會產生更小的特徵具有更多細節,而高的比例會產生具有更大特徵的更平滑的雜訊。


Vector3 turbulence_noise_speed = Vector3(0, 0, 0) 🔗

  • void set_turbulence_noise_speed(value: Vector3)

  • Vector3 get_turbulence_noise_speed()

湍流場的滾動速度。設定的是圖案隨時間移動的方向趨勢。

預設值 Vector3(0, 0, 0) 會將滾動關閉。


float turbulence_noise_speed_random = 0.2 🔗

  • void set_turbulence_noise_speed_random(value: float)

  • float get_turbulence_noise_speed_random()

湍流場的原地變化率。會決定雜訊圖案隨時間變化的快慢。

值為 0.0 時得到的是固定的圖案。


float turbulence_noise_strength = 1.0 🔗

  • void set_turbulence_noise_strength(value: float)

  • float get_turbulence_noise_strength()

湍流雜訊強度。增加此值將導致更強烈、對比度更高的雜訊圖案。


bool use_rotation_3d = false 🔗

  • void set_use_rotation_3d(value: bool)

  • bool is_using_rotation_3d()

Enable the usage of rotation_3d_min and rotation_3d_max.


bool use_rotation_velocity_3d = false 🔗

  • void set_using_rotation_velocity_3d(value: bool)

  • bool is_using_rotation_velocity_3d()

Enable 3D rotation velocity.


bool use_scale_3d = false 🔗

  • void set_use_scale_3d(value: bool)

  • bool is_using_scale_3d()

Enable the usage of scale_3d_min and scale_3d_max.


Texture2D velocity_limit_curve 🔗

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


Vector3 velocity_pivot = Vector3(0, 0, 0) 🔗

  • void set_velocity_pivot(value: Vector3)

  • Vector3 get_velocity_pivot()

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


方法說明

Vector2 get_param(param: Parameter) const 🔗

Returns the minimum and maximum values of the given param as a vector.

The x component of the returned vector corresponds to minimum and the y component corresponds to maximum.


float get_param_max(param: Parameter) const 🔗

返回給定參數的最大值範圍。


float get_param_min(param: Parameter) const 🔗

返回給定參數的最小值範圍。


Texture2D get_param_texture(param: Parameter) const 🔗

返回指定參數所使用的 Texture2D


bool get_particle_flag(particle_flag: ParticleFlags) const 🔗

Returns true if the specified particle flag is enabled.


void set_param(param: Parameter, value: Vector2) 🔗

Sets the minimum and maximum values of the given param.

The x component of the argument vector corresponds to minimum and the y component corresponds to maximum.


void set_param_max(param: Parameter, value: float) 🔗

設定給定參數的最大值範圍。


void set_param_min(param: Parameter, value: float) 🔗

設定給定參數的最小值範圍。


void set_param_texture(param: Parameter, texture: Texture2D) 🔗

為指定的 Parameter 設定 Texture2D


void set_particle_flag(particle_flag: ParticleFlags, enable: bool) 🔗

Sets the particle_flag to enable.