# Rain effect causes screenshots to fail?

**URL:** <https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003>\
**Category:** Bugs\
**Created:** [January 30, 2021, 3:21am UTC](https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003 "2021-01-30T03:21:33Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![JacobF](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jacobf/32/36046_2.png) [@JacobF](https://forum.babylonjs.com/u/JacobF)\
**Post date:** [January 30, 2021, 3:21am UTC](https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003/1 "2021-01-30T03:21:33Z")

</div>

See this demo:

[https://playground.babylonjs.com/#1S4RQG#1](https://playground.babylonjs.com/#1S4RQG#1)

Look around with the mouse and notice a bunch of screenshots being generated in the sky are blank.

Took me a couple of hours to figure out the rain effect was the cause in my game. What’s going on here?

---

<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:** [January 30, 2021, 5:02pm UTC](https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003/2 "2021-01-30T17:02:50Z")

</div>

The rain particle system is creating/deleting a lot of sub particle systems / nodes and for some reasons it interferes with the screenshot…

I didn’t find another way than pausing the particle systems (meaning, stop calling the `animate` function) just before taking the screenshot and unpausing them just after:

[https://playground.babylonjs.com/#1S4RQG#27](https://playground.babylonjs.com/#1S4RQG#27)

---

<div class="post-metadata">

**Author:** ![JacobF](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/jacobf/32/36046_2.png) [@JacobF](https://forum.babylonjs.com/u/JacobF)\
**Post date:** [January 30, 2021, 6:18pm UTC](https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003/3 "2021-01-30T18:18:22Z")

</div>

Interesting. I noticed toggling this.scene.particlesEnabled in the same way also works. Both ways remove the rain from the screenshot (maybe the rain is never in the screenshot?)

This looks like a big to me…

---

<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:** [January 30, 2021, 7:27pm UTC](https://forum.babylonjs.com/t/rain-effect-causes-screenshots-to-fail/18003/4 "2021-01-30T19:27:31Z")

</div>

The rain is not in the screenshot because of the way the particle systems are handled in the render target texture. See this thread for more info: [Screenshot and ParticleSystem - #2 by Evgeni\_Popov](https://forum.babylonjs.com/t/screenshot-and-particlesystem/6508/2)

To sum up: if a particle system has no emitter or has an emitter which is not an `AbstractMesh`, the particle system is not rendered in the texture.

In fact, the emitter does not have to be an `AbstractMesh` but it mush have a position property and a `isEnabled()` method. Also, this emitter must be in the list of the visible meshes of the frame.

So, you have a way to make the rain visible in the screenshot: set a dummy value to the `emitter` property to all the particle systems before taking the screenshot and reset back this property after:

[https://playground.babylonjs.com/#1S4RQG#31](https://playground.babylonjs.com/#1S4RQG#31)
