Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Resolved Monterey Safari 15.1 broken graphics

Discussion in 'WebGL' started by Dan_Kodable, Oct 27, 2021.

  1. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    [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 :

    Screen Shot 2021-10-27 at 8.39.07 AM.png
    Screen Shot 2021-10-27 at 8.38.53 AM.png

    With WebGL 2.0 disabled :
    Screen Shot 2021-10-27 at 8.39.57 AM.png
    Screen Shot 2021-10-27 at 8.40.04 AM.png

    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.
     
    Last edited: Jan 25, 2022
  2. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    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.
     
  3. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    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.
     
  4. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
  5. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Thanks, I'll check it out. Definitely want to get any webgl2 bugs reported to Apple as soon as possible.
     
  6. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    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?
     
  7. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    That’s strange we had it happen on 3 different machines, 2 intel based MacBook Pro 16” and an M1 mac mini
     
  8. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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.
     
  9. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    I don't know if it matters but all of my images are on sprite atlases and loaded via addressables.
     
  10. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    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.
     
    De-Panther likes this.
  11. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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.
     
  12. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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.
     
  13. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    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. https://bugs.webkit.org/show_bug.cgi?id=230107

    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.
     
  14. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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
     

    Attached Files:

  15. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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
     
    Last edited: Nov 8, 2021
  16. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Can you file a issue for this so we can properly track it?
     
  17. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Also, are you using a custom loader? I don't recognize that line.
     
  18. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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
     
  19. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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)
     
  20. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    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...
     
  21. brendanduncan_u3d

    brendanduncan_u3d

    Unity Technologies

    Joined:
    Jul 30, 2019
    Posts:
    334
    Thanks for the info. We'll get it looked into.
     
  22. Xorboo

    Xorboo

    Joined:
    Dec 6, 2014
    Posts:
    6
    Can confirm, this issue is also happening for us, MacBook Air (M1, 2020), Monterey 12.0.1.
    Sorry don't have any simple repro steps, don't have direct access to a Mac where it is reproduced and the project is also somewhat big.
     
  23. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
  24. Peter-Dijkstra

    Peter-Dijkstra

    Joined:
    Feb 15, 2013
    Posts:
    8
    Hi,

    Some of our users are reporting similar issues. I haven't been able to replicate them myself, unfortunately. Vertices seem to get stretched in all kinds of ways rendering the game unplayable. All of them are running Safari 15. Seems like sometimes the game doesn't load either. Our game is running on 2019.4.33.

    Am I right in assuming that we have to wait for Apple to fix this?
     
  25. mykhailov-ihor

    mykhailov-ihor

    Joined:
    Jan 16, 2016
    Posts:
    4
    Last edited: Jan 11, 2022
  26. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    100
    We're still seeing this on 2021.2.7; M1 Max on Monterey.
    It this something we're still waiting on Apple to fix? Our app is UI heavy, so it's currently unplayable on Safari.
     
  27. tomkail_betterup

    tomkail_betterup

    Joined:
    Nov 17, 2021
    Posts:
    100
    For those looking for a fix, we've found that using WebGL 1 (disable Auto Graphics API, remove WebGL 2) resolves this until Apple fix this on their end. Bug seems to be at least 3 months old so it beats waiting!
     
  28. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    Update to this -
    We have just started our testing today, but so far Safari 15.2 seems to have fixed this issue.
    Will update if it happens again.
     
    Newcomma likes this.
  29. Newcomma

    Newcomma

    Joined:
    Feb 10, 2015
    Posts:
    89
    Nice - could you edit your OG post to 'solved'?
     
  30. Dan_Kodable

    Dan_Kodable

    Joined:
    May 12, 2020
    Posts:
    30
    So far it appears to be working with our testing.
     
  31. TechnicalArtist

    TechnicalArtist

    Joined:
    Jul 9, 2012
    Posts:
    736
    Hi @Dan_Kodable ,we are facing same issue,in our case crating issue in mac Book air in safari, firefox & Chrome also,i tried to re-produce in simpler scene but I can't.