When I use Babylonjs to render a .glb file(which has about 60 materials), I found it get a bad performance to render the first frame in mobile mode(compared with threejs or playcanvas).
BTW: if i delete all materials of this .glb file, it performance as fast as threejs/laycanvas.
I would appreciate it if anyone have any suggestions!!
above is the performance snapshot
babylonjs snapshot:
Thanks for your reply
I found that this maybe a bug caused by the engine’s not setting the engine.disableUniformBuffers property correctly in mobile mode.
When I visit my project in my browser in normal mode, after I create my engine,the engine.disableUniformBuffers is true,and it perform well.
But when I change my browser to mobile mode, the engine.disableUniformBuffers value become false,which cause a bad performance .
We look for “Mac OS.+Chrome” in the user-agent to disable ubo support. It would seem that when you switch to mobile mode (what does that mean?) the user-agent does not match this string…
Can you report what you get when you type navigator.userAgent in the browser console?
noraml mode => ‘Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36’
mobile mode => ‘Mozilla/5.0 (iPhone; CPU iPhone OS 13_2_3 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0.3 Mobile/15E148 Safari/604.1’
sorry for my poor english: ‘mobile mode’ means I turn on this button in the chorme’s dev tools;
Thanks for the clarification (no need to apologize, I think “mobile mode” is quite appropriate for this button, it’s just that I’m not used to it!).
As this is an emulation mode, I don’t think it can be trusted: it says “Safari” in the user-agent, whereas you’re testing with Chrome. We would need to know whether you’re still experiencing the same problem with a real device(?)
The slow UBO issue has been proven to be only an issue on Chrome MAC so the Mobile mode emulation does not reflect real world usage at all here even more cause your simulating an android device.
I ll be happy to dig in if you repro in a real device as we can not bypass the mozilla… user agent without risking to be counter productive on the real devices.