complex_shapes.rst 4.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. .. _doc_3d_particles_complex_shapes:
  2. Complex emission shapes
  3. -----------------------
  4. .. figure:: img/particle_complex_emission.webp
  5. :alt: Complex emission shapes
  6. When it is not enough to emit particles from one of the simple shapes available
  7. in the :ref:`process material <doc_process_material_properties_shapes>`, Godot provides
  8. a way to emit particles from arbitrary, complex shapes. The shapes are generated from
  9. meshes in the scene and stored as textures in the particle process material. This is a
  10. very versatile workflow that has allowed users to use particle systems for things that
  11. go beyond traditional use cases, like foliage, leaves on a tree, or complex
  12. holographic effects.
  13. .. note::
  14. When you create emission points from meshes, you can only select a single node as
  15. emission source. If you want particles to emit from multiple shapes, you either
  16. have to create several particle systems or combine the meshes into one in an
  17. external DCC software.
  18. .. figure:: img/particle_create_emission_points.webp
  19. :alt: Creating emission points
  20. :align: right
  21. Create particle emission points...
  22. .. figure:: img/particle_select_emission_mesh.webp
  23. :alt: Select mesh for emission
  24. :align: right
  25. \...from a mesh instance as the source
  26. .. figure:: img/particle_emission_density.webp
  27. :alt: Set emission density
  28. :align: right
  29. More points = higher particle density
  30. To make use of this feature, start by creating a particle system in the current scene.
  31. Add a mesh instance that serves as the source of the particle emission points. With the
  32. particle system selected, navigate to the viewport menu and select the *GPUParticles3D*
  33. entry. From there, select ``Create Emission Points From Node``.
  34. A dialog window will pop up and ask you to select a node as the emission source.
  35. Choose one of the mesh instances in the scene and confirm your selection. The next
  36. dialog window deals with the amount of points and how to generate them.
  37. ``Emission Points`` controls the total number of points that you are about to generate.
  38. Particles will spawn from these points, so what to enter here depends on the
  39. size of the source mesh (how much area you have to cover) and the desired density of
  40. the particles.
  41. ``Emission Source`` offers 3 different options for how the points are generated.
  42. Select ``Surface Points`` if all you want to do is distribute the emission points across the
  43. surface of the mesh. Select ``Surface Points + Normal (Directed)`` if you also want to
  44. generate information about the surface normals and make particles move in the direction
  45. that the normals point at. The last option, ``Volume``, creates emission points everywhere
  46. inside the mesh, not just across its surface.
  47. The emission points are stored in the particle system's local coordinate system, so
  48. you can move the particle node around and the emission points will follow. This might be
  49. useful when you want to use the same particle system in several different places. On the
  50. other hand, you might have to regenerate the emission points when you move either
  51. the particle system or the source mesh.
  52. Emission shape textures
  53. ~~~~~~~~~~~~~~~~~~~~~~~
  54. .. figure:: img/particle_emission_textures.webp
  55. :alt: Emission textures
  56. :align: right
  57. The available emission shape textures
  58. All the data for complex particle emission shapes is stored in a set of textures. How
  59. many, depends on the type of emission shape you use. If you set the ``Shape`` property
  60. in the ``Emission Shape`` group on the particle process material to ``Points``, you
  61. have access to 2 texture properties, the ``Point Texture`` and the ``Color Texture``.
  62. Set it to ``Directed Points`` and there is a third property called ``Normal Texture``.
  63. ``Point Texture`` contains all possible emission points that were generated in the
  64. previous step. A point is randomly selected for every particle when it spawns.
  65. ``Normal Texture``, if it exists, provides a direction vector at that same location.
  66. If the ``Color Texture`` property is also set, it provides color for the particle,
  67. sampled at the same location as the other two textures and modulating any other color
  68. that was set up on the process material.
  69. There is also the ``Point Count`` property that you can use to change the number of
  70. emission points at any time after creating the emission shape. This includes dynamically
  71. at runtime while the playing the game.