Recently switched from sketchfab api to babylon js, and while everything went okay with the transition, there seems to be a problem on iOS devices. Whenever we try to run the project on an ios device, that device will keep refreshing itself and display the message "a problem repeatedly occurred … ". It works with no issues on Android devices and on PC, only mobile iOs does not seem to work.
My projects works this way:
- one main scene with one 3d model and you can hover around it (so a 15mb model and a camera, no HDR, no lights);
- while the users moves around the first model, we load the second model in the background in another scene (so that the user wont have to wait to download the model when they switch scenes). The second model is a bit larger at ~55mb.
- when the user moves to the second scene or when the second model is finished loading, everything crashes.
Things I tried:
- I’ve seen the memory leak issue here, and I deactivated any resizing and set the canvas to a static width and height and the problem still appeared.
- Tried to lower the engine rendering quality, and I still encounter the problem.
- Tried to split the second model into 3 smaller models
- Instead of loading my 3 models, I decided to load 3 models from babylonjs model library (1 fish and 1 helmet ~ 100mb) and it will still crash
- Tried loading all models into the same scene, instead of having 2 scenes
- Tried having two engines (one for each scene)
After all of this, I tried recreating the scene in a playground, loaded all assets there, and it worked. Which made me believe the problem is that we’re using React as the front-end. If I run only the scripts, in a html+js page, without React, it works aswell.
Anybody else here who tried running a babylonjs app with react front-end and ran into similar problems?
Thanks in advance, and if needed I can also provide assets/code in private
Manage to reproduce the error in playground aswell. playground . babylonjs . com /#I1R7HB#13 (delete the spaces. Can t add more than 2 links as a new user)
first I load my building, and then I load 2 big models. If I load only one of the big models, it works without crash. If I load both of them, when they finish loading, the playground crashes on iPhone.
Video demo since I noticed sometimes it does not crash(but most of the time it does)