# Problems Rendering a single frame when using multiple cameras and layermasks

**URL:** <https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112>\
**Category:** Questions\
**Created:** [May 25, 2023, 4:33am UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112 "2023-05-25T04:33:35Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anupam\_Das](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/anupam_das/32/16709_2.png) [@Anupam\_Das](https://forum.babylonjs.com/u/Anupam_Das)\
**Post date:** [May 25, 2023, 4:33am UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112/1 "2023-05-25T04:33:35Z")

</div>

pg: [https://playground.babylonjs.com/#08A2BS#242](https://playground.babylonjs.com/#08A2BS#242)

Hi all, in the above PG, you can see that I stop the render loop then try to render a single frame. Problem is the background image does not show up. Im wondering if there is some callback I need to wait for that fires when the post process compositing is finished? I looked into some of the callbacks available in the DefaultRenderingPipeline but nothing I do seems to make a difference. As a side note: the technique for rendering the BG as a seperate layer was borrowed from another thread:

> [@Adding a background image that is not affected by the Default Rendering Pipeline post processes](https://forum.babylonjs.com/t/adding-a-background-image-that-is-not-affected-by-the-default-rendering-pipeline-post-processes/34494/5):
>
> @Evgeni_Popov @sebavan Update! I have found some breakage with recent updates to babylon with this particular technique and we’re experiencing this after updating to ^5.53.1. (^5.21.0 was working for us) See PG example: this happens when we set the HDR mode in the DefaultRenderingPipeline to true We do need HDR PP , we cant really rely on LDR. Is this a bug or is there a better way to do this?

---

<div class="post-metadata">

**Author:** ![Cedric](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/cedric/32/2742_2.png) [@Cedric](https://forum.babylonjs.com/u/Cedric)\
**Post date:** [May 25, 2023, 8:16am UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112/2 "2023-05-25T08:16:15Z")

</div>

I’m not sure how to fix PG. ping @Evgeni_Popov

---

<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:** [May 25, 2023, 10:02am UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112/3 "2023-05-25T10:02:44Z")

</div>



---

<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:** [May 25, 2023, 1:26pm UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112/4 "2023-05-25T13:26:55Z")

</div>

This PR will fix the problem by checking that the layers are ready in `scene.isReady`:

> <https://github.com/BabylonJS/Babylon.js/pull/13896>
>
> See https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-m…ultiple-cameras-and-layermasks/41112

---

<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:** [May 25, 2023, 1:26pm UTC](https://forum.babylonjs.com/t/problems-rendering-a-single-frame-when-using-multiple-cameras-and-layermasks/41112/5 "2023-05-25T13:26:57Z")

</div>


