WebGL context lost - new safari 14 context lost with cubeTexture

I found a bug related to the new safari 14 and of course the new iOS 14.
When creating a dynamic ReflectionProbe with cubeTextue and than resizing the canvas WebGL context is lost and meshes from the screen disappear (I couldn’t find any way of recovering from this state)

steps to reproduce:

  1. made a simple playground containing both a mesh with PbrTexture and a ReflectionProbe with cube texture
  2. Open safari beta desktop or safari mobile on iOS 14
  3. let the model load for a second
  4. resize the window and see that context is lost

As always, will very much appreciate your help!

Hello, if it is only IOS 14 and Safari Beta you should definitely provide them the feedback as it could help them address it before their final release.

There is unfortunately not much we can do on our side in this case :frowning:

Hi @sebavan thanks a lot for your quick reply :slight_smile:
Apple already started rolling out iOS 14, for example 5% of our iOS users are using iOS 14 already and this is by all means not a technical audience, those are normal people that just got an update to their phone.
I would love to open a new issue to safari, but I have a hard time believing that they are as kind as you guys (this forum saved my life couple of times :stuck_out_tongue_winking_eye:) so I fear that we might get to a situation in which they will publish this version in a few weeks and a lot of babylonjs users will encounter this bug then.
Furthermore, I think that opening a bug to safari will require me to provide them with much more specific details, I will love to do that but I’m not familiar with Babylonjs internal code, so if you will be able to help me out with that it will be great.

is it running in webgl2 on ios14 ?

if yes my recommandation would be to disable it for now and if no we definitely need a better workaround.

I ll try as well on the safari beta just to see if I can gather more info.

Actually I am seeing an issue on Chrome Windows too here ?

looks like you try to read and right from the probe at the same time might be the root cause on IOS as well ?

basically one of your mesh in both in the probe and using the probe ???

1 Like

Thanks again,

It’s still using WebGL 1 on iOS 14.

I’m using mac and I don’t see any problem on chrome (84.0.4147.89) or safari (13.x)
Is it a problem that the same mesh is both in the probe and using it?

yep this will stress some renderer (like on iOS ;)) as there is a loop (you need to mesh to render the texture used to render the mesh used to render the texture…)


Well… I said earlier that this forum saved my life a couple of times, yet another save by the awesome babylon team.

Changed my playground to:

Which seems to fix the problem, thanks a lot you guys!