# Particle cloud?

**URL:** <https://forum.castle-engine.io/t/particle-cloud/827>\
**Category:** Uncategorized\
**Created:** [June 17, 2023, 2:30pm UTC](https://forum.castle-engine.io/t/particle-cloud/827 "2023-06-17T14:30:11Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![edj](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/edj/32/1701_2.png) [@edj](https://forum.castle-engine.io/u/edj)\
**Post date:** [June 17, 2023, 2:30pm UTC](https://forum.castle-engine.io/t/particle-cloud/827/1 "2023-06-17T14:30:11Z")

</div>

The procedural trees in my wyrd forest playground are coming along nicely. It is time to do leaves. I see them elsewhere implemented as particle clouds with a persistent random seed or hash that keeps particles fixed. What is recommended to use for particle clouds in cge? I see there is a particle emitter component but that doesn’t seem like what I want? Does cge support particle cloud? Otherwise I can create a sphere with random leaf locations in it, but want it to be as fast and light as possible (so it can be a real forest).

 ![wyrd-forest_screen_110](https://forum.castle-engine.io/uploads/default/original/2X/d/dc309180b63f82f366fa7de76167263b923d48a5.jpeg)

---

<div class="post-metadata">

**Author:** ![edj](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/edj/32/1701_2.png) [@edj](https://forum.castle-engine.io/u/edj)\
**Post date:** [June 18, 2023, 6:12pm UTC](https://forum.castle-engine.io/t/particle-cloud/827/2 "2023-06-18T18:12:14Z")

</div>

The code from [Geometry3D component | Castle Game Engine](https://castle-engine.io/x3d_implementation_geometry3d.php) makes a great leaf cloud. It looks legit.

 ![wyrd-forest_screen_119](https://forum.castle-engine.io/uploads/default/original/2X/9/98f2c692762d809ca7a194600184faab9b39207d.jpeg)

---

<div class="post-metadata">

**Author:** ![michalis](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/michalis/32/3_2.png) [@michalis](https://forum.castle-engine.io/u/michalis)\
**Post date:** [June 19, 2023, 8:38pm UTC](https://forum.castle-engine.io/t/particle-cloud/827/3 "2023-06-19T20:38:34Z")

</div>

If you want to construct static 3D meshes, then indeed you can just build them using X3D nodes like TIndexedFaceSet, TIndexedTriangleSet, TTriangleSet and such. For a simplest quad, use TQuadSet. The examples from [Geometry3D component | Castle Game Engine](https://castle-engine.io/x3d_implementation_geometry3d.php) and [Writing code to modify scenes and transformations | Manual | Castle Game Engine](https://castle-engine.io/viewport_and_scenes_from_code#_building_a_mesh_using_code) (" 11. Building a mesh using code") may be helpful.

As for particle clouds: I don’t think you really want to involve particle systems for this case. In any case, we have external components in CGE now to do particles: [Additional Components | Castle Game Engine](https://castle-engine.io/additional_components.php) , see “Particle Emitter” and " Effekseer Integration" mentioned there.

It could be possible create leaves geometry using geometry shaders ( [Programmable shaders component | Castle Game Engine](https://castle-engine.io/x3d_implementation_shaders.php#section_geometry) ).

But for start, I’d say that 1st solution, simplest, is best. Just build meshes of leaves from X3D nodes like TIndexedFaceSet, TIndexedTriangleSet, TTriangleSet, TQuadSet.

---

<div class="post-metadata">

**Author:** ![edj](https://forum.castle-engine.io/user_avatar/forum.castle-engine.io/edj/32/1701_2.png) [@edj](https://forum.castle-engine.io/u/edj)\
**Post date:** [June 20, 2023, 2:46pm UTC](https://forum.castle-engine.io/t/particle-cloud/827/4 "2023-06-20T14:46:21Z")

</div>

That is what I ended up doing. Using just one face for the leaf… and then adding random faces in the leaf cloud. It looks really good and seems fast.

 ![wyrd-forest_screen_124](https://forum.castle-engine.io/uploads/default/original/2X/e/ee8d5e90853ad9480ae28fbd7814c0b888134b83.jpeg)
