Particles

Inherits: GeometryInstance < VisualInstance < CullInstance < Spatial < Node < Object

GPU-based 3D particle emitter.

Descripción

3D particle node used to create a variety of particle systems and effects. Particles features an emitter that generates some number of particles at a given rate.

Use the process_material property to add a ParticlesMaterial to configure particle appearance and behavior. Alternatively, you can add a ShaderMaterial which will be applied to all particles.

Note: Particles only work when using the GLES3 renderer. If using the GLES2 renderer, use CPUParticles instead. You can convert Particles to CPUParticles by selecting the node, clicking the Particles menu at the top of the 3D editor viewport then choosing Convert to CPUParticles.

Note: After working on a Particles node, remember to update its visibility_aabb by selecting it, clicking the Particles menu at the top of the 3D editor viewport then choose Generate Visibility AABB. Otherwise, particles may suddenly disappear depending on the camera position and angle.

Tutoriales

Propiedades

int

amount

8

DrawOrder

draw_order

0

Mesh

draw_pass_1

Mesh

draw_pass_2

Mesh

draw_pass_3

Mesh

draw_pass_4

int

draw_passes

1

bool

emitting

true

float

explosiveness

0.0

int

fixed_fps

0

bool

fract_delta

true

float

lifetime

1.0

bool

local_coords

true

bool

one_shot

false

float

preprocess

0.0

Material

process_material

float

randomness

0.0

float

speed_scale

1.0

AABB

visibility_aabb

AABB( -4, -4, -4, 8, 8, 8 )

Métodos

AABB

capture_aabb ( ) const

Mesh

get_draw_pass_mesh ( int pass ) const

void

restart ( )

void

set_draw_pass_mesh ( int pass, Mesh mesh )

Enumeraciones

enum DrawOrder:

  • DRAW_ORDER_INDEX = 0 --- Las partículas se dibujan en el orden en que se emiten.

  • DRAW_ORDER_LIFETIME = 1 --- Las partículas se dibujan en orden según el tiempo de vida restante.

  • DRAW_ORDER_VIEW_DEPTH = 2 --- Las partículas se dibujan en orden de profundidad.

Constantes

  • MAX_DRAW_PASSES = 4 --- Número máximo de pases de dibujado soportados.

Descripciones de Propiedades

Default

8

Setter

set_amount(value)

Getter

get_amount()

The number of particles emitted in one emission cycle (corresponding to the lifetime).

Note: Changing amount will reset the particle emission, therefore removing all particles that were already emitted before changing amount.


Default

0

Setter

set_draw_order(value)

Getter

get_draw_order()

Orden de dibujo de las partículas. Utiliza los valores de DrawOrder.


Setter

set_draw_pass_mesh(value)

Getter

get_draw_pass_mesh()

Mesh que se dibuja para el primer pase de dibujado.


Setter

set_draw_pass_mesh(value)

Getter

get_draw_pass_mesh()

Mesh que se dibuja para el segundo pase de dibujado.


Setter

set_draw_pass_mesh(value)

Getter

get_draw_pass_mesh()

Mesh que se dibuja para el tercer pase de dibujado.


Setter

set_draw_pass_mesh(value)

Getter

get_draw_pass_mesh()

Mesh que se dibuja para el cuarto pase de dibujado.


  • int draw_passes

Default

1

Setter

set_draw_passes(value)

Getter

get_draw_passes()

El número de pases de dibujado cuando se renderizan las partículas.


Default

true

Setter

set_emitting(value)

Getter

is_emitting()

Si true, se están emitiendo partículas.


Default

0.0

Setter

set_explosiveness_ratio(value)

Getter

get_explosiveness_ratio()

Ratio de tiempo entre cada emisión. Si 0, las partículas se emiten continuamente. Si 1, todas las partículas se emiten simultáneamente.


  • int fixed_fps

Default

0

Setter

set_fixed_fps(value)

Getter

get_fixed_fps()

La velocidad de fotogramas del sistema de partículas está fijada a un valor. Por ejemplo, cambiando el valor a 2 hará que las partículas se rendericen a 2 fotogramas por segundo. Ten en cuenta que esto no ralentiza la simulación del sistema de partículas en sí.


Default

true

Setter

set_fractional_delta(value)

Getter

get_fractional_delta()

Si true, resulta en un cálculo delta fraccionario que tiene un efecto de visualización de partículas más suave.


Default

1.0

Setter

set_lifetime(value)

Getter

get_lifetime()

The amount of time each particle will exist (in seconds).


Default

true

Setter

set_use_local_coordinates(value)

Getter

get_use_local_coordinates()

Si true, las partículas usan el espacio de coordenadas del nodo padre. Si false, usan las coordenadas globales.


Default

false

Setter

set_one_shot(value)

Getter

get_one_shot()

Si true, sólo se emitirán partículas de amount.


Default

0.0

Setter

set_pre_process_time(value)

Getter

get_pre_process_time()

Cantidad de tiempo para preprocesar las partículas antes de que comience la animación. Te permite iniciar la animación un tiempo después de que las partículas hayan empezado a emitir.


Setter

set_process_material(value)

Getter

get_process_material()

Material para procesar partículas. Puede ser un ParticlesMaterial o un ShaderMaterial.


Default

0.0

Setter

set_randomness_ratio(value)

Getter

get_randomness_ratio()

Ratio de aleatoriedad de las emisiones.


Default

1.0

Setter

set_speed_scale(value)

Getter

get_speed_scale()

Relación de escala de velocidad. Un valor de 0 puede ser usado para pausar las partículas.


  • AABB visibility_aabb

Default

AABB( -4, -4, -4, 8, 8, 8 )

Setter

set_visibility_aabb(value)

Getter

get_visibility_aabb()

The AABB that determines the node's region which needs to be visible on screen for the particle system to be active.

Grow the box if particles suddenly appear/disappear when the node enters/exits the screen. The AABB can be grown via code or with the Particles → Generate AABB editor tool.

Note: If the ParticlesMaterial in use is configured to cast shadows, you may want to enlarge this AABB to ensure the shadow is updated when particles are off-screen.

Descripciones de Métodos

  • AABB capture_aabb ( ) const

Devuelve el cuadro delimitador alineado con el eje que contiene todas las partículas que están activas en el cuadro actual.


  • Mesh get_draw_pass_mesh ( int pass ) const

Devuelve la Mesh que se dibuja en el índice pass.


  • void restart ( )

Reinicia la emisión de partículas, limpiando las partículas existentes.


  • void set_draw_pass_mesh ( int pass, Mesh mesh )

Establece la Mesh que se dibuja en el índice pass.