# BabylonJS (5.0 - 5.5.5) & iOS 15.4 + Safari 15.4 issues

**URL:** <https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195>\
**Category:** Questions\
**Created:** [May 9, 2022, 1:14pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195 "2022-05-09T13:14:02Z")\
**Posts on this page:** 17\
**Page:** 2

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [May 12, 2022, 12:00pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/22 "2022-05-12T12:00:26Z")

</div>

Ok, so back at it again.

I just noticed that taking a screenshot with **Tools.CreateScreenshotUsingRenderTarget** does not work.  
And this error is only happening if SSAO2 is enabled.

Please take a look at the following playground and let me know if this bug can be soon fixed or if there is a workaround to it.  
[https://playground.babylonjs.com/#7D2QDD#32](https://playground.babylonjs.com/#7D2QDD#32)

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:** [May 12, 2022, 4:08pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/23 "2022-05-12T16:08:12Z")

</div>

I do not think the pipeline can be used on renderTarget, can you change the canvas size, use createScreenShot instead ?

cc @CraigFeldspar in case he knows why we can not use it in RTT ?

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [May 13, 2022, 7:16am UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/24 "2022-05-13T07:16:30Z")

</div>

Thank you for your response.

Ok, but why can the pipeline be used on renderTarget on BabylonJS version \< 5.0 and not on BabylonJS version \> 5.0?

On the playground example that I posted above you can just switch the Babylon version to 4.2.1 and you will see that the pipeline can actually be used on renderTarget. Meaning that the screenshot gets generated with SSAO2 just fine.

Thank you, and I hope there is a solution for this.

---

<div class="post-metadata">

**Author:** ![CraigFeldspar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/craigfeldspar/32/45631_2.png) [@CraigFeldspar](https://forum.babylonjs.com/u/CraigFeldspar)\
**Post date:** [May 14, 2022, 4:26pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/25 "2022-05-14T16:26:11Z")

</div>

Screenshot tools directly call `render` on the RTT without the prepass textures being rendered. Outside of the normal `scene.render` pipeline, prepass can have an undefined behavior.  
4.2.1 version of babylon uses the geometrybufferrenderer, so if you want to replicate that behavior, use @sebavan’s suggestion :  
`BABYLON.SSAO2RenderingPipeline("ssao", scene, ssaoRatio, undefined, true);`

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [May 16, 2022, 8:53am UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/26 "2022-05-16T08:53:09Z")

</div>

Actually it works just fine.

Thank you. 🙂

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [July 5, 2022, 1:29pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/27 "2022-07-05T13:29:02Z")

</div>

Hi again @sebavan @CraigFeldspar,

I had to test again on the matter of SSAO2 and taking a screenshot with it and finally noticed where the issue stands.

I have created two playgrounds, one with the Babylon version 4.2.1 and the other with the latest Babylon which produces the issue.

Now, I just take a screenshot with SSAO2 enabled using Babylon 4.2.1 and everything works fine:  
[https://playground.babylonjs.com/#7D2QDD#44](https://playground.babylonjs.com/#7D2QDD#44)

But, when I take the screenshot with SSAO2 enabled using a Babylon version \> 5.0 I get this:  
[https://playground.babylonjs.com/#7D2QDD#43](https://playground.babylonjs.com/#7D2QDD#43)

The SSAO2 doesn’t look right with Babylon version \> 5.0.

And what i noticed is that this only happens when the screenshot resolution is defined on Babylon \> 5.0.  
If you remove the defined resolution on the **Tools.CreateScreenshotUsingRenderTarget()** the SSO2 will look fine on Babylon \> 5.0 too.

Is it possible to make this work with any defined resolution? It would really help us in generating screenshots with any resolution we need.

Thank you, and I hope there is a solution for it soon. 🙂

Regards,  
Gerald

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 5, 2022, 5:00pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/28 "2022-07-05T17:00:37Z")

</div>

cc @CraigFeldspar can you please have a look as soon as you can?

thanks a ton!

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [July 8, 2022, 10:13am UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/29 "2022-07-08T10:13:22Z")

</div>

Hi guys,

Is there any update on this issue?

Thanks a lot. 🙂

---

<div class="post-metadata">

**Author:** ![NRA](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nra/32/25376_2.png) [@NRA](https://forum.babylonjs.com/u/NRA)\
**Post date:** [July 8, 2022, 1:41pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/30 "2022-07-08T13:41:24Z")

</div>

Hi,

If helps, I opened both PGs and the snapshots taken looks equal. I used Win11 and Edge to do it.

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [July 8, 2022, 1:55pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/32 "2022-07-08T13:55:09Z")

</div>

@NRA its still broken compared to v4.2.1.  
You may need to switch to Babylon version 4.2.1 to see that the screenshots aren’t equal.

---

<div class="post-metadata">

**Author:** ![NRA](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/nra/32/25376_2.png) [@NRA](https://forum.babylonjs.com/u/NRA)\
**Post date:** [July 8, 2022, 1:56pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/33 "2022-07-08T13:56:50Z")

</div>

@Gerald

Sorry, you are right!

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [July 8, 2022, 1:58pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/34 "2022-07-08T13:58:55Z")

</div>

@NRA Let’s hope it will be fixed. 😁

---

<div class="post-metadata">

**Author:** ![Deltakosh](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/deltakosh/32/26635_2.png) [@Deltakosh](https://forum.babylonjs.com/u/Deltakosh)\
**Post date:** [July 8, 2022, 2:33pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/35 "2022-07-08T14:33:57Z")

</div>

Adding a few folks as @CraigFeldspar may be on vacation  
@sebavan (on vacation but will be back in a week) @Evgeni_Popov (on vacation too)

Please be a bit more patient than usual as almost everyone is enjoying summer time 😉

---

<div class="post-metadata">

**Author:** ![Gerald](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/gerald/32/18996_2.png) [@Gerald](https://forum.babylonjs.com/u/Gerald)\
**Post date:** [July 8, 2022, 2:56pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/36 "2022-07-08T14:56:52Z")

</div>

Enjoy your vacation guys. 😃

Just let us know after that is hopefully fixed. 🙂

---

<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:** [July 8, 2022, 4:47pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/37 "2022-07-08T16:47:25Z")

</div>

This PR will fix the problem:

> <https://github.com/BabylonJS/Babylon.js/pull/12726>
>
> See https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issue…s/30195/27

---

<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:** [July 8, 2022, 6:38pm UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/38 "2022-07-08T18:38:21Z")

</div>

So glad you already found it !!! Thanks a ton @Evgeni_Popov

---

<div class="post-metadata">

**Author:** ![CraigFeldspar](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/craigfeldspar/32/45631_2.png) [@CraigFeldspar](https://forum.babylonjs.com/u/CraigFeldspar)\
**Post date:** [July 12, 2022, 10:29am UTC](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195/39 "2022-07-12T10:29:31Z")

</div>

Also back from off time, thanks @Evgeni_Popov ! good catch

[Previous page](https://forum.babylonjs.com/t/babylonjs-5-0-5-5-5-ios-15-4-safari-15-4-issues/30195.md?page=1)
