# Hide particles in the built-in fog

**URL:** <https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815>\
**Category:** Questions\
**Created:** [February 4, 2024, 9:53pm UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815 "2024-02-04T21:53:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Foxhoundn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/foxhoundn/32/15613_2.png) [@Foxhoundn](https://forum.babylonjs.com/u/Foxhoundn)\
**Post date:** [February 4, 2024, 9:53pm UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/1 "2024-02-04T21:53:40Z")

</div>

Hey,

I would like to hide certain particles from the built-in fog. I found this:

> **[Babylon.js Playground](https://playground.babylonjs.com/#0K3AQ2%23618)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

```auto
// Load our node material
let nodeMaterial = await BABYLON.NodeMaterial.ParseFromSnippetAsync("HMP5KD#5", scene);
  
// Apply it to the particle system
nodeMaterial.createEffectForParticles(particleSystem);

```

but I have no idea where the NodeMaterial snippet is coming from. Is there a built-in way to achieve the same thing?

EDIT: @Evgeni_Popov Hi! It looks like the playground was created by you 🙂 Could you help?

Thanks!

---

<div class="post-metadata">

**Author:** ![sebavan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/sebavan/32/57_2.png) [@sebavan](https://forum.babylonjs.com/u/sebavan)\
**Post date:** [February 5, 2024, 6:53pm UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/2 "2024-02-05T18:53:55Z")

</div>

Assigned @Evgeni\_Popov on February 5, 2024, 6:53pm UTC



---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 6, 2024, 10:30am UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/3 "2024-02-06T10:30:31Z")

</div>

This PR will add support for fog to particle systems:

> <https://github.com/BabylonJS/Babylon.js/pull/14765>
>
> See https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815

When the PR is merged, you need to do `yourParticleSystem.applyFog = true` to enable it (and enable fog at the scene level, of course!).

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 6, 2024, 10:30am UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/4 "2024-02-06T10:30:34Z")

</div>

Unassigned @Evgeni\_Popov on February 6, 2024, 10:30am UTC



---

<div class="post-metadata">

**Author:** ![Foxhoundn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/foxhoundn/32/15613_2.png) [@Foxhoundn](https://forum.babylonjs.com/u/Foxhoundn)\
**Post date:** [February 6, 2024, 11:04am UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/5 "2024-02-06T11:04:33Z")

</div>

You’re a rockstar pop \<3 - any chance it could also be done for `Lines`? As far as I can see lines created with `CreateLines` also ignore fog.

---

<div class="post-metadata">

**Author:** ![Evgeni\_Popov](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/evgeni_popov/32/4432_2.png) [@Evgeni\_Popov](https://forum.babylonjs.com/u/Evgeni_Popov)\
**Post date:** [February 6, 2024, 2:14pm UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/6 "2024-02-06T14:14:48Z")

</div>

Sure:

> <https://github.com/BabylonJS/Babylon.js/pull/14768>
>
> See https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/4

This PG will work once this PR is merged:

> **[Babylon.js Playground](https://playground.babylonjs.com/#T90MQ4%2316)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL 3D scenes

---

<div class="post-metadata">

**Author:** ![Foxhoundn](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/foxhoundn/32/15613_2.png) [@Foxhoundn](https://forum.babylonjs.com/u/Foxhoundn)\
**Post date:** [February 6, 2024, 2:39pm UTC](https://forum.babylonjs.com/t/hide-particles-in-the-built-in-fog/47815/7 "2024-02-06T14:39:18Z")

</div>

Awesome, can’t wait to test it!!!
