[Solved]
Edit : updating to Safari 15.2 fixes this issue
So it appears that Safari 15.1 has an issue with it’s WebGL 2.0 implementation.
I have tried loading our game on Safari 15.0 running on MacOS Big Sur with WebGL 2.0 enabled (by default) and it works normally and as expected, but with the same build on MacOS Monterey (12.0.1) and Safari 15.1 with WebGL 2.0 enabled (by default) the game has massive graphical issues and slows way down.
If I turn off WebGL 2.0 in Safari’s developer settings and reload the game it works fine.
With WebGL 2.0 enabled :
With WebGL 2.0 disabled :
The Live build was made with Unity 2021.1.22f1
I also remade a new build this morning with Unity 2021.1.27f1 with the same result.
Is there anything we can do? Is Unity aware of the issue? If so is there a fix in any beta releases we could use?
For reference you can view the problem by going to https://game.kodable.com it does require an account, but you can sign up as a teacher for free.
We have been testing Safari 15 WebGL2, and have submitted some bug reports to Apple for issues, but I haven’t seen issues like this yet. I’ll take a look your site to see if there’s anything I can figure out without a repo bug report project.
Can you tell me how to get to a game, I tried looking for one one the site a bit but it wasn’t immediately obvious how to try a game.
The simplest way would be to do the demo
https://game.kodable.com/teacher-demo
Thanks, I’ll check it out. Definitely want to get any webgl2 bugs reported to Apple as soon as possible.
I upgraded my Mac to Monterey and Safari 15.1 and the game seems to render correctly for me, I haven’t seen any glitches.
What hardware are you running on?
Can you try deleting the browser cache?
That’s strange we had it happen on 3 different machines, 2 intel based MacBook Pro 16” and an M1 mac mini
Another note : playing around with it, it seems to only happen with UI elements present, in a scene where there are only sprites, it doesn’t seem to occur.
I don’t know if it matters but all of my images are on sprite atlases and loaded via addressables.
Clicking through the screens I finally got a “Fuzzy Fall Festival” window that had some issues. Not as extreme as what you showed, but performance did drop a lot and had some rendering artifacts.
Are you using UI Toolkit? I wonder if this is the same bug in the Safari WebGL Metal backend they fixed for us recently, which was triggered by UI Toolkit. I had only seen that issue on iOS before, but it could be happening on desktop too.
1 Like
We are not specifically using it, and we haven’t imported it as a package, but I can not rule out the possibility that a plugin/package we have installed might be accessing it.
I made a simple build in a brand new project (2021.1.27f1) with a single scene and a few UI images on a single atlas, and it’s working normally.
So other than the UI Toolkit possibility you mentioned, the only difference, besides the obvious mountain that is our code, would be the use of Addressables.
I don’t think it would have anything to do with Addressables. It seems like the Safari WebGL2 Metal issue. It wasn’t UI Toolkit specifically that caused the issue, but it triggered it; other things could be triggering it too. If it is that issue, which I had only ever seen on iOS before, it has been fixed, but it’s Apple, you never know when it will be released. 230107 – [WebGL2, Safari 15 - iOS15] Problems with drawElements in some conditions
If you can find a way to repro it in a smaller test example, that would be greatly appreciated. I’ll do some investigation too.
Ok so I made a build of our game with 2021.2.1f1 today, and safari no longer loads the game. Instead I get this -
see screenshot attached
It loads normally on all other browsers
I changed various settings, and made more builds with 2021.2, same result
the loader.js call it’s referring to is this
d=String.fromCharCode.apply(null,e.subarray(r,r+i));
Again, the 2021.2 build works fine on other browsers, just safari on both monterey and big sur, for this issue
Can you file a issue for this so we can properly track it?
Also, are you using a custom loader? I don’t recognize that line.
It is the loader that Unity generated. I am not using a custom one.
I do have a custom HTML file, but the loader.js is generated by the build from unity
I filed a bug report for the new issue, don’t know if it’s related or the same issue at all…
https://fogbugz.unity3d.com/default.asp?1379238_39rk6iffms54uvgh
I did get this issue to occur with an empty(new/default) unity project, using all the defaults including the generated HTML file instead of my custom one.
More info -
I am using Unity 2021.2.1f1 as described in the issue, on Windows 10 (latest) 64bit
Testing on Safari 15.1, as described, on a Macbook Pro running MacOS Monterey (12.0.1)
Oh I just realized there is no way for me to update the bug report, so I will mention it here.
If I forceably turn off WebGL 2.0 and/or WebGL via Metal settings in Safari, it makes no change, so I am uncertain if it is the same issue, or a completely new one, but I am just guessing…