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 2D Usage

Process material properties

ParticleProcessMaterial properties

Min, max, and curve properties

The properties in this material control how particles behave and change over their lifetime. A lot of them have Min, Max, and Curve values that allow you to fine-tune their behavior. The relationship between these values is this: When a particle is spawned, the property is set with a random value between Min and Max. If Min and Max are the same, the value will always be the same for every particle. If the Curve is also set, the value of the property will be multiplied by the value of the curve at the current point in a particle's lifetime. Use the curve to change a property over the particle lifetime. Very complex behavior can be expressed this way.

Nota

This page covers how to use ParticleProcessMaterial for 2D scenes specifically. For information on how to use it in a 3D scene see Process material properties.

Lifetime Randomness

The Lifetime Randomness property controls how much randomness to apply to each particle's lifetime. A value of 0 means there is no randomness at all and all particles live for the same amount of time, set by the Lifetime property. A value of 1 means that a particle's lifetime is completely random within the range of [0.0, Lifetime].

Particle Flags

Spawn

Ângulo

Determina o ângulo inicial da partícula (em graus). Este parâmetro é principalmente útil randomizado.

../../_images/paranim11.gif

Velocity

Direção

Esta é a direção básica na qual as partículas emitem. O padrão é Vector3(1, 0, 0) que faz com que as partículas emitam para a direita. No entanto, com as configurações de gravidade padrão, as partículas irão direto para baixo.

../../_images/direction1.png

Para que essa propriedade seja perceptível, você precisa de uma velocidade inicial maior que 0. Aqui, definimos a velocidade inicial como 40. Você notará que as partículas emitem para a direita e depois descem devido à gravidade.

../../_images/direction2.png

Espalhar

Este parâmetro é o ângulo em graus que será adicionado aleatoriamente em qualquer direção à base Direction. Uma propagação de 180 emitirá em todas as direções (+/- 180). Para que o spread faça qualquer coisa, o parâmetro "Initial Velocity" deve ser maior que 0.

../../_images/paranim3.gif

Planicidade

Esta propriedade só é útil para partículas 3D.

Velocidade Inicial

Velocidade inicial é a velocidade na qual as partículas serão emitidas (em pixels/seg). A velocidade pode mais tarde ser modificada pela gravidade ou outras acelerações (conforme descrito mais adiante).

../../_images/paranim4.gif

Animated Velocity

Velocidade Angular

Angular velocity is the speed at which particles rotate around their center (in degrees/sec).

../../_images/paranim5.gif

Velocidade Orbital

A velocidade da órbita é usada para fazer as partículas girarem em torno de seu centro.

../../_images/paranim6.gif

Accelerations

Gravidade

A gravidade aplicada a todas as partículas.

../../_images/paranim7.gif

Aceleração Linear

A aceleração linear aplicada a cada partícula.

Aceleração Radial

Se esta aceleração for positiva, as partículas são aceleradas para longe do centro. Se negativo, eles são absorvidos por ele.

../../_images/paranim8.gif

Aceleração Tangencial

Essa aceleração usará o vetor tangente ao centro. Combinando com aceleração radial pode fazer bons efeitos.

../../_images/paranim9.gif

Amortecimento

Damping aplica fricção às partículas, forçando-as a parar. É especialmente útil para faíscas ou explosões, que geralmente começam com uma alta velocidade linear e param quando desaparecem.

../../_images/paranim10.gif

Display

Escala

Determina a escala inicial das partículas.

../../_images/paranim12.gif

Color Curves

Cor

Usado para alterar a cor das partículas que estão sendo emitidas.

Hue Variation

O valor Variation define a variação de tom inicial aplicada a cada partícula. O valor Variation Random controla a taxa de aleatoriedade da variação de tom.

Animação

Nota

Particle flipbook animation is only effective if the CanvasItemMaterial used on the GPUParticles2D or CPUParticles2D node has been configured accordingly.

To set up the particle flipbook for linear playback, set the Speed Min and Speed Max values to 1:

Setting up particle animation for playback during the particle's lifetime

Setting up particle animation for playback during the particle's lifetime

By default, looping is disabled. If the particle is done playing before its lifetime ends, the particle will keep using the flipbook's last frame (which may be fully transparent depending on how the flipbook texture is designed). If looping is enabled, the animation will loop back to the first frame and resume playing.

Depending on how many images your sprite sheet contains and for how long your particle is alive, the animation might not look smooth. The relationship between particle lifetime, animation speed, and number of images in the sprite sheet is this:

Nota

At an animation speed of 1.0, the animation will reach the last image in the sequence just as the particle's lifetime ends.

\[Animation\ FPS = \frac{Number\ of\ images}{Lifetime}\]

If you wish the particle flipbook to be used as a source of random particle textures for every particle, keep the speed values at 0 and set Offset Max to 1 instead:

Setting up particle animation for random offset on emission

Setting up particle animation for random offset on emission

Note that the GPUParticles2D node's Fixed FPS also affects animation playback. For smooth animation playback, it's recommended to set it to 0 so that the particle is simulated on every rendered frame. If this is not an option for your use case, set Fixed FPS to be equal to the effective framerate used by the flipbook animation (see above for the formula).

Formas de Emissão

ParticleProcessMaterials allow you to set an Emission Mask, which dictates the area and direction in which particles are emitted. These can be generated from textures in your project.

Ensure that a ParticleProcessMaterial is set, and the GPUParticles2D node is selected. A "Particles" menu should appear in the Toolbar:

../../_images/emission_shapes1.webp

Abra-a e selecione "Load Emission Mask" (Carregar Máscara de Emissões):

../../_images/emission_shapes2.webp

Em seguida, selecione qual textura você deseja usar como sua máscara:

../../_images/emission_shapes3.webp

Uma caixa de diálogo com várias configurações aparecerá.

Máscara de Emissão

Três tipos de máscaras de emissão podem ser gerados a partir de uma textura:

  • Pixels Sólidos: Partículas surgirão de qualquer área da textura, excluindo áreas transparentes.

../../_images/emission_mask_solid.gif
  • Pixels da borda: as partículas serão geradas nas bordas externas da textura.

../../_images/emission_mask_border.gif
  • Pixels de borda direcionados: semelhantes aos pixels de borda, mas adicionam informações extras à máscara para dar às partículas a capacidade de emitir para longe das bordas. Observe que uma velocidade inicial precisará ser definida para utilizar isso.

../../_images/emission_mask_directed_border.gif

Cores de Emissão

Capture from Pixel fará com que as partículas herdem a cor da máscara em seus pontos de geração.

Once you click "OK", the mask will be generated and set to the ParticleProcessMaterial, under Spawn and then Position

../../_images/emission_shapes4.webp

Todos os valores nesta seção foram gerados automaticamente pelo menu "Load Emission Mask", portanto, geralmente não de deve mexer em nada.

Nota

Uma imagem não deve ser adicionada a Point Texture ou Color Texture diretamente. O menu "Load Emission Mask" deve ser sempre utilizado em seu lugar.