properties.rst 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203
  1. .. _doc_3d_particles_properties:
  2. 3D Particle system properties
  3. -----------------------------
  4. Emitter properties
  5. ~~~~~~~~~~~~~~~~~~
  6. .. figure:: img/particle_props_emitter.webp
  7. :align: right
  8. The checkbox next to the ``Emitting`` property activates and deactivates the particle system. Particles will
  9. only be processed and rendered if the box is checked. You can set this property at runtime if you
  10. want to activate or deactivate particle systems dynamically.
  11. The ``Amount`` property controls the maximum number of particles visible at any given time. Increase the
  12. value to spawn more particles at the cost of performance.
  13. The ``Amount Ratio`` property is the ratio of particles compared to the amount that will be emitted.
  14. If it's less than ``1.0``, the amount of particles emitted through the lifetime will be the ``Amount`` *
  15. ``Amount Ratio``. Changing this value while emitted doesn't affect already created particles and doesn't
  16. cause the particle system to restart. It's useful for making effects where the number of emitted particles
  17. varies over time.
  18. You can set another particle node as a ``Sub Emitter``, which will be spawned as a child of each
  19. particle. See the :ref:`Sub-emitters <doc_3d_particles_subemitters>` section in this manual for a detailed explanation of how
  20. to add a sub-emitter to a particle system.
  21. .. _doc_3d_particles_properties_time:
  22. Time properties
  23. ~~~~~~~~~~~~~~~
  24. .. figure:: img/particle_props_time.webp
  25. :align: right
  26. The ``Lifetime`` property controls how long each particle exists before it disappears again. It
  27. is measured in seconds. A lot of particle properties can be set to change over the particle's
  28. lifetime and blend smoothly from one value to another.
  29. ``Lifetime`` and ``Amount`` are related. They determine the particle system's emission rate.
  30. Whenever you want to know how many particles are spawned per second, this is the formula you
  31. would use:
  32. .. math::
  33. Particles per second = \frac{Amount}{Lifetime}
  34. Example: Emitting 32 particles with a lifetime of 4 seconds each would mean the system emits
  35. 8 particles per second.
  36. The ``Interp to End`` property causes all the particles in the node to interpolate towards
  37. the end of their lifetime.
  38. If the checkbox next to the ``One Shot`` property is checked, the particle system will emit ``amount`` particles
  39. and then disable itself. It "runs" only once. This property is unchecked by default, so the system will
  40. keep emitting particles until it is disabled or destroyed manually. One-shot particles are a good fit for
  41. effects that react to a single event, like item pickups or splinters that burst away when a bullet hits a wall.
  42. The ``Preprocess`` property is a way to fast-forward to a point in the middle of the
  43. particle system's lifetime and start rendering from there. It is measured in seconds. A value of
  44. ``1`` means that when the particle system starts, it will look as if it has been
  45. running for one second already.
  46. This can be useful if you want the particle system to look like it has been active for a while even
  47. though it was just loaded into the scene. Consider the example below. Both particle systems simulate
  48. dust flying around in the area. With a preprocess value of ``0``, there wouldn't be any dust for the
  49. first couple of seconds because the system has not yet emitted enough particles for the effect to
  50. become noticeable. This can be seen in the video on the left. Compare that to the video on the
  51. right where the particle system is preprocessed for ``4`` seconds. The dust is fully visible from
  52. the very beginning because we skipped the first four seconds of "setup" time.
  53. .. figure:: img/particle_preprocess.webp
  54. No preprocess (left) vs. 4 seconds of preprocess (right)
  55. You can slow down or speed up the particle system with the ``Speed Scale`` property. This applies
  56. to processing the data as well as rendering the particles. Set it to ``0`` to pause the particle
  57. system completely or set it to something like ``2`` to make it move twice as fast.
  58. .. figure:: img/particle_speed_scale.webp
  59. Different speed scale values: 0.1 (left), 0.5 (middle), 1.0 (right)
  60. The ``Explosiveness`` property controls whether particles are emitted sequentially or simultaneously.
  61. A value of ``0`` means that particles emit one after the other.
  62. A value of ``1`` means that all ``amount`` particles emit at the same time, giving
  63. the effect a more "explosive" appearance.
  64. The ``Randomness`` property adds some randomness to the particle emission timing. When set to ``0``,
  65. there is no randomness at all and the interval between the emission of one particle and
  66. the next is always the same: the particles are emitted at *regular* intervals. A ``Randomness``
  67. value of ``1`` makes the interval completely random. You can use this property to break
  68. up some of the uniformity in your effects. When ``Explosiveness`` is set to ``1``, this
  69. property has no effect.
  70. .. figure:: img/particle_interpolate.webp
  71. :alt: Particles running at low FPS
  72. :align: right
  73. Interpolation off (left) vs. on (right)
  74. The ``Fixed FPS`` property limits how often the particle system is processed. This includes
  75. property updates as well as collision and attractors. This can improve performance a lot,
  76. especially in scenes that make heavy use of particle collision. Note that this does not
  77. change the speed at which particles move or rotate. You would use the ``Speed Scale``
  78. property for that.
  79. When you set ``Fixed FPS`` to very low values, you will notice that
  80. the particle animation starts to look choppy. This can sometimes be desired if it fits
  81. the art direction, but most of the time, you'll want particle systems to animate smoothly.
  82. That's what the ``Interpolate`` property does. It blends particle properties between
  83. updates so that even a particle system running at ``10`` FPS appears as smooth as
  84. running at ``60``.
  85. .. note::
  86. When using :ref:`particle collision <doc_3d_particles_collision>`, tunneling can occur
  87. if the particles move fast and colliders are thin. This can be remedied by increasing
  88. ``Fixed FPS`` (at a performance cost).
  89. .. _doc_3d_particles_properties_collision:
  90. Collision properties
  91. ~~~~~~~~~~~~~~~~~~~~
  92. .. seealso::
  93. Setting up particle collision requires following further steps described in
  94. :ref:`doc_3d_particles_collision`.
  95. The ``Base Size`` property defines each particle's default collision size, which is used
  96. to check whether a particle is currently colliding with the environment. You would usually want this
  97. to be about the same size as the particle. It can make sense to increase this value
  98. for particles that are very small and move very fast to prevent them from clipping
  99. through the collision geometry.
  100. .. _doc_3d_particles_properties_draw:
  101. Drawing properties
  102. ~~~~~~~~~~~~~~~~~~
  103. .. figure:: img/particle_drawing.webp
  104. :alt: Particle drawing properties
  105. :align: right
  106. The ``Visibility AABB`` property defines a box around the particle system's origin.
  107. As long as any part of this box is in the camera's field of view, the particle system
  108. is visible. As soon as it leaves the camera's field of view, the particle system stops
  109. being rendered at all. You can use this property to boost performance by keeping the
  110. box as small as possible.
  111. One thing to keep in mind when you set a size for the ``Visibility AABB`` is that particles
  112. that are outside of its bounds disappear instantly when it leaves the camera's field of view.
  113. Particle collision will also not occur outside the ``Visibility AABB``.
  114. While not technically a bug, this can have a negative effect on the visual experience.
  115. When the ``Local Coords`` property is checked, all particle calculations use the local
  116. coordinate system to determine things like up and down, gravity, and movement direction.
  117. Up and down, for example, would follow the particle system's or its parent node's rotation.
  118. When the property is unchecked, the global world space is used for these calculations:
  119. Down will always be -Y in world space, regardless of the particle system's rotation.
  120. .. figure:: img/particle_coords.webp
  121. Local space coordinates (left) vs. world space coordinates (right)
  122. The ``Draw Order`` property controls the order in which individual particles are drawn. ``Index`` means
  123. that they are drawn in the order of emission: particles that are spawned later are drawn
  124. on top of earlier ones. ``Lifetime`` means that they are drawn in the order of their
  125. remaining lifetime. ``Reverse Lifetime`` reverses the ``Lifetime`` draw order. ``View Depth``
  126. means particles are drawn according to their distance from the camera: The ones closer
  127. to the camera on top of those farther away.
  128. The ``Transform Align`` property controls the particle's default rotation. ``Disabled``
  129. means they don't align in any
  130. particular way. Instead, their rotation is determined by the values set in the process
  131. material. ``Z-Billboard`` means that the particles will always face the camera. This is
  132. similar to the ``Billboard`` property in the :ref:`Standard Material <doc_standard_material_3d>`.
  133. ``Y to Velocity`` means that each particle's Y-axis aligns with its movement
  134. direction. This can be useful for things like bullets or arrows, where you want particles
  135. to always point "forward". ``Z-Billboard + Y to Velocity`` combines the previous two modes.
  136. Each particle's Z-axis will point towards the camera while its Y-axis will align with
  137. their velocity.
  138. Trail properties
  139. ~~~~~~~~~~~~~~~~
  140. .. figure:: img/particle_trail.webp
  141. :alt: Particle trails
  142. :align: right
  143. Particle trail properties
  144. The ``Enabled`` property controls whether particles are rendered as trails. The box needs
  145. to be checked if you want to make use of particle trails.
  146. The ``Length Secs`` property controls for how long a trail should be emitted. The longer
  147. this duration is, the longer the trail will be.
  148. See the :ref:`Particle trails <doc_3d_particles_trails>` section in this manual for a detailed
  149. explanation of how particle trails work and how to set them up.