Search Unity

WebGL is not working in Safari Web Browser

Discussion in 'Web' started by VenkyXander, Dec 22, 2017.

  1. VenkyXander

    VenkyXander

    Joined:
    Jun 20, 2017
    Posts:
    4
    Hello Devs,

    I have created a game with the build platform WEBGL. It works fine on Chrome and Firefox but when i run it on Safari for Windows i get the following message "Your browser does not support WebGL", after removing the compatibiltyCheck() function in UnityLoader.js i get another error which says "Your browser does not support any of the required graphics API for this content: WebGL 1.0 , WebGL 2.0". I am currently using 5.1.7 version of Safari.

    Any help would be appreciated, thanks in advance!
     
  2. _neobine

    _neobine

    Joined:
    Oct 27, 2014
    Posts:
    8
  3. VenkyXander

    VenkyXander

    Joined:
    Jun 20, 2017
    Posts:
    4
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,205
  5. VenkyXander

    VenkyXander

    Joined:
    Jun 20, 2017
    Posts:
    4

    Attached Files:

  6. blacKode

    blacKode

    Joined:
    May 21, 2015
    Posts:
    38
    Safari for Windows it has no support since May 9, 2012... Safari 5.x support webgl only in Mac... and the support is it is primitive and obsolete.
     
  7. arumiat

    arumiat

    Joined:
    Apr 26, 2014
    Posts:
    321
    I too am trying to release webGL 2.0 content but have received complaints that it doesn't load in Safari. Anyone know if Safari is looking to fix this issue?

    What is the workaround, should the graphics automatically fallback to webGL 1.0 somehow?
     
    AlejMC likes this.
  8. AlejMC

    AlejMC

    Joined:
    Oct 15, 2013
    Posts:
    149
    Having the same issue. On my side, I have to tell people to use either Chrome or Firefox on OS X...
    I can confirm that Chrome for both Windows 7, 8, 10 and OSX does run Unity WebGL with not too much tweaking efforts, combined with itch.io webpage allows for a very easy way to host the game on their servers.

    Maybe on the WebGL player settings something could be done on the WebGL/ES type of settings?
     
  9. mfor1967

    mfor1967

    Joined:
    Sep 14, 2018
    Posts:
    2
    I am trying to get Unity 2018.3.0f2 to work in Safari on a mac. Safari does have Develop->Experimental Features->WebGL 2.0 selected. Unity has been built with Auto Graphics API set to on, or set to WebGL 2.0. Neither work. Scads of WebGL errors in the console.
    Is this a Unity issue, or Safari? Unity runs fine in Chrome.
     
  10. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    WebGL 2.0 implementation on Safari is known to be broken, however, Unity WebGL content should work fine with WebGL 1.0.
     
  11. mfor1967

    mfor1967

    Joined:
    Sep 14, 2018
    Posts:
    2
    Yes, turning off Auto Graphics API and entering WebGL 1.0 works. Once again, the problem was the driver, not the vehicle ;)
     
  12. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    I am having trouble in safari as well... Light seems to not work in Safari. I am using Auto-Graphics API option. Safari uses openGL 1.0 and Chrome picks 2.0 due to Auto graphics API and the results are different of lights in both browsers.
     

    Attached Files:

  13. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    Here are the results for WebGL1.0 for both browsers.

    Chrome one is brighter and Safari one is dull.
     

    Attached Files:

  14. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Are you sure Chrome is not using WebGL2.0?
    What about Firefox?
     
  15. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    Yes I am. I mentioned in the second post that I disabled Auto Graphics API in player settings and only kept openGL 1 in the player settings. and the screen shots are from Chrome and Safari respectively. Checked in Firefox working fine.
     
  16. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Then maybe it's a bug in Safari? is there any warning/error in the log?
     
  17. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    No warnings/errors. I am using Safari 12.0.3. Safari Does support OpenGL ES 2.0.
     
    Levak2002 likes this.
  18. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    Try to send us a repro so we can determine whether it's a Safari or Unity bug.
     
  19. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    Here is the screenshot of the Error I get only in Safari.
     

    Attached Files:

  20. IsmaeelShujat

    IsmaeelShujat

    Joined:
    May 18, 2017
    Posts:
    13
    So, Turns out that spot light is not supported by Safari OpenGL 2.0. I had two spot lights in the box(I created with 6 quads) shape. The Spot Lights in the box had no light effect in the box. Directional Light in the scene only works to create light effect.
     
  21. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    This is a weird thing because I have had lights (point and spot) work fine on Safari with a build made with 2019.3.15 and the standard rendering. Once I updated to 2019.4 and URP the lights no longer work on Safari, exact same light setup (only directionals now work on safari). But could be some other setting, I've been trying every setting combination I can think of.
     
  22. wuannetraam

    wuannetraam

    Joined:
    Oct 29, 2019
    Posts:
    87
    Hi,

    We've had all these problems a while back and luckily were able to fix it. Safari is really a game break tho for webgl. Your stuck to WebGL 1.0. To get this to work you should turn off Auto Graphics API and then you need to remove Webgl2.0 and only leave Webgl1.0 in it. That would fix the webgl error. Another problem that can occur is with ASM.js and WASM.js. Safari gives errors with WASM so you need to make sure that you set your project to ASM.

    The way to do this:
    Go to your project folder then go to ProjectSettings folder and open the file "ProjectSettings" in a text editor.
    Then search for "webGLLinkerTarget:" It's probarly set to "1" (WASM). Make sure to change that to "0" (ASM).
    That should fix your next problem.

    Also make sure your "webGLMemorySize:" is set to something like 128mb

    To fix the lights problem. Check this thread I posted a while back. There is a fix in there.
    https://forum.unity.com/threads/no-spot-point-lights-in-webgl-on-ios.780461/


    Hope this helps. It took me weeks to fix this.



    Best,
    Maarten
     
    Meltdown and Archigesture like this.
  23. MythicalCity

    MythicalCity

    Joined:
    Feb 10, 2011
    Posts:
    420
    Thanks Maarten, I tried setting the API to 1.0 but it didn't help, just caused things to look worse in other browsers.

    I saw that post with the Unity response about changing the file and tried that bit it also didn't help with the lights (at least with URP). I ended up switching back to standard rendering with unity 2019.4.0 and it works fine on safari and chrome (but performance is a bit more limited than it was with URP).

    I haven't tried the ASM thing so I'll give that a go.