Safari poor performance on Safari?

I’m getting poor performance on mac Safari browser, every other browser is running fine, but just drops to 10fps when playing on Safari, anyone know why this might be?

Is there issues with graphics libraries? API issues? Driver issues? Anything that can help me figure this out, or an explanation.

Are you trying to use their new webgl2 support ? I am not reproducing any issues on my mac.

No, just what the Unity Toolkit uses, I’m assuming out of the box it’s webgl, also there’s more resources on my game (that I can’t upload yet) that I don’t think you would see it by opening an empty project in safari.

I’m looking at the profile of the safari game, it seems it’s auto pushing it to 4k, is there a way I can limit that to hd?

Also I just logged the engine.webGLVersion out in safari, it seems it’s rolling back to Webgl 1.

So, how would you suggest I force a smaller resolution on Safari? @sebavan :smiley:

Adding @MackeyK24 as he might know if there are any known issues with the toolkit and how to force a smaller raise.

Chrome is the best performing browser with BabylonJS… from what I can tell…

Safari is the worst. By default no webgl2 …try enabling that and try again

Yeah I notice that it’s automatically scaling the resolution to 4k even on lower end machines, is there any way I can set it by default in either the html (.config, .html) or even in code? @sebavan, I don’t need to force it in the Toolkit.
I tried setting it after export, but nothing:

Unless @MackeyK24 is there a setting that will export a max resolution?

I’m sorry… I must have missed what you are talking about forcing 4K

Force what to 4K … some kind of texture ???

When you create an instance of the engine, the 4th parameters should be false to ensure we do not scale to native dpi. Or you can use after the fact engine.setHardwareScalingLevel(1)

@sebavan Happy new Year xD

I am facing performance issue in Safari and Firefox webGL 2 with BabylonJS 4.2, in those browsers I get like 20 FPS but in Google Chrome it’s normal to 60 FPS, I tried your suggestion with 4th parameter new BABYLON.Engine(canvas, true, '', false) and also with engine.setHardwareScalingLevel(1) , but it has no effect. how can I debug this?

You should use your performance explorer from safari to understand what is going on

I tried with Firefox and this is what it is showing, not sure what to look at:

I see this warning in Firefox
"
WebGL warning: generateMipmap: Tex image TEXTURE_CUBE_MAP_POSITIVE_X level 0 is incurring lazy initialization."

what is that?

edit: not sure if above warning is issue, I only loaded an empty scene but still I see those warnings.

could you repro in the playground cause it is impossible to help without the code on this kind of issue :frowning:

1 Like