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.
Checking the stable version of the documentation...
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¶
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
||
|
Métodos¶
capture_aabb ( ) const |
|
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¶
int amount
Default |
|
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.
DrawOrder draw_order
Default |
|
Setter |
set_draw_order(value) |
Getter |
get_draw_order() |
Orden de dibujo de las partículas. Utiliza los valores de DrawOrder.
Mesh draw_pass_1
Setter |
set_draw_pass_mesh(value) |
Getter |
get_draw_pass_mesh() |
Mesh que se dibuja para el primer pase de dibujado.
Mesh draw_pass_2
Setter |
set_draw_pass_mesh(value) |
Getter |
get_draw_pass_mesh() |
Mesh que se dibuja para el segundo pase de dibujado.
Mesh draw_pass_3
Setter |
set_draw_pass_mesh(value) |
Getter |
get_draw_pass_mesh() |
Mesh que se dibuja para el tercer pase de dibujado.
Mesh draw_pass_4
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 |
|
Setter |
set_draw_passes(value) |
Getter |
get_draw_passes() |
El número de pases de dibujado cuando se renderizan las partículas.
bool emitting
Default |
|
Setter |
set_emitting(value) |
Getter |
is_emitting() |
Si true
, se están emitiendo partículas.
float explosiveness
Default |
|
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 |
|
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í.
bool fract_delta
Default |
|
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.
float lifetime
Default |
|
Setter |
set_lifetime(value) |
Getter |
get_lifetime() |
The amount of time each particle will exist (in seconds).
bool local_coords
Default |
|
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.
bool one_shot
Default |
|
Setter |
set_one_shot(value) |
Getter |
get_one_shot() |
Si true
, sólo se emitirán partículas de amount
.
float preprocess
Default |
|
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.
Material process_material
Setter |
set_process_material(value) |
Getter |
get_process_material() |
Material para procesar partículas. Puede ser un ParticlesMaterial o un ShaderMaterial.
float randomness
Default |
|
Setter |
set_randomness_ratio(value) |
Getter |
get_randomness_ratio() |
Ratio de aleatoriedad de las emisiones.
float speed_scale
Default |
|
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 |
|
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.
Devuelve la Mesh que se dibuja en el índice pass
.
void restart ( )
Reinicia la emisión de partículas, limpiando las partículas existentes.
Establece la Mesh que se dibuja en el índice pass
.