Request for help: Does your WebGL 2 game render correctly in Safari Tech Preview?

Hi all,

Apple is developing WebGL 2 support into Safari browser. For some while now, Safari Tech Preview has had experimental WebGL 2 support enabled by default. We are hoping towards speedy release of their WebGL 2 support, and have been coordinating with them to make sure that Unity WebGL 2 builds render properly on Safari Tech Preview.

While we have run the browser through a battery of different test cases, it is no substitute to running it for real in the wild, and it is possible that there are issues that we have not caught. If you are developing a game for WebGL 2 and are interested in Safari, I would like to ask you to download Safari Tech Preview at Safari Technology Preview - Safari - Apple Developer , then build your game by disabling WebGL 1 from Graphics API list (disable Auto Graphics API project build option) and only enable WebGL 2.

Finally, cross reference the results against Chrome or Firefox on the same device, and see if there are any differences. If so, please either report here on this thread, or open a bug using the Unity Bug Reporter and CC a link to this thread.

This can help ensure more confidence that when Apple decides to release WebGL 2 by default, that it will have as few corner cases in Safari as possible.

When doing this test, it can help to open the Safari Devtools web console to check if there are any errors that are printed. Even if everything seems to be rendering correctly, sometimes there can be rendering errors posted in the browser’s log.

If you gave it a spin, and everything did work out ok without bugs, it can also be helpful to post a “worked for me” comment in this thread.

Help the world get rid of WebGL 1 finally :slight_smile:

9 Likes

We have a pretty complex application, and it worked!

1 Like

Tested a project today, found 2 issues:

  • Fullscreen doesn’t work (but I think this is not a problem in Unity’s side)
  • I’m using cursor locking together with a mouselook script, and when the cursor lock is released, it stutters and dumps about 10 or 12 Performance Warning: Recreating Offscreen FBO messages. This doesn’t happen on Chrome, Firefox, or Chromium browsers.
    Also, performance is worse than in other browsers.

@Hypertectonic Would you be able to post full logs about the Performance Warning event? And/or a video?

i don’t have a mac here, but i asked 2 workmates to test it.
and it seems it worked.

you can test the build in my signature if u want.

Cool app - works great for me (Windows 10, Chrome).

I know you asked about rendering but I tested our game Smash Karts on the tech preview and it has major audio issues.

For now we are hosting a WebGL 2.0 only version - https://smashkarts.io/webgl2/

Let me know if you have problems noticing the issue. For me I just need to start playing and the audio starts to break up and sounds really strange after about 30 seconds. We have never seen this issue before on normal Safari.

Thanks for testing @TallJohn ! Any chance you’d be able to report the issue to https://bugs.webkit.org/ ? Or if you’d rather not go through the hassle, then would you be able to record a video showcasing the issue, and I can create a webkit bug and link to the forum thread here?

No problem. Here is a video showing the audio issue.

I was testing on -
Safari Technical Preview: Release 120 (Safari 14.2, WebKit 16612.1.2.6)
Unity 2020.1.17f1

For now the WebGL2 only version of the game is available at https://smashkarts.io/webgl2/ I will leave it up there for the next few weeks at least in case anyone needs to check it out.

@jukka_j please post the bug. I have not familiar with Webkit bug posting.

Great, thanks! Reported 222098 – Regression: Raw AudioBufferSourceNode playback causes repeated crackling sound about this.

1 Like

Is there a way to install it on iOS? (Quick Google search had results only for Mac)

1 Like

My understanding is that it requires a specially signed image from Apple, so no customer STP for iOS. (that is a bit silly :frowning: ). At least I have not heard of any other way either.

1 Like

Thank you for starting this thread, jukka_j! It’s great to see Unity continuing to invest in WebGL.

Unfortunately, my site does not load at all under WebGL 2 in Safari on the latest version of macOS Big Sur + Safari.

(Note: the site is not currently publicly accessible, so you aren’t able to try it yourself, but I’d be more than happy to send you/others at Unity a link you can play around with — or even the full source if it’d be helpful.)

Here are the browser logs from the site: https://gist.githubusercontent.com/aroman/36d00876ca9548f532ebead419648199/raw/05d84d39aa4af4a788a1107d482c4fb5f7967bd8/webgl2_big_sur

Of note:

  1. The build is set to WebGL2 support only and works under Firefox and Chrome
  2. At one point I did allow WebGL 1 support for my game, and it did work under Safari (with a noticeably performance hit). However I’ve had to disable it since because I need to use the Linear color space and stencil/depth buffer, both of which have issues or are unsupported entirely under WebGL1 via Unity.

Thanks for raising the issue @aromana . We should definitely sync up on this. Either of the two paths:

  1. Would you be able to slim down most heavy assets and excess scripts of that project, and report it as a bug to Unity tracker? We can then triage it to double check it is not something that is wrong in Unity, and route it out to Apple if needed, or
  2. Report it directly to Apple at https://bugs.webkit.org/ (though they’ll need a repro link to run on)

Let me know if one of these works.

Just submitted a bug including my full project. I mentioned your username in the bug report, hopefully you can find it that way (I’ve been on your end of this interaction a few times :)). Removing excess scripts might be challenging, but since the issue occurs with 0 user intervention (it fails to load entirely), it should be simple enough to see the issue. For reference, this is what you should expect to see if it loads successfully. The project should load to this screen under Firefox and Chrome.

Perfect, thank you so much! I’ll give the QA a bit of time to go through the report and verify it. Sometimes they do cleaning/reduction steps of their own, which can be a lot of help for our dev team.

@TallJohn Looks like Apple acknowledged the audio issue last night, and did some bisecting investigation on it already, so hopefully it will get resolved soon.

1 Like

Thanks! By the way, my project also suffered from the audio distortion bug being discussed above - actually back on Safari with WebGL1. At the time I noticed that there were a lot of “virtual audio channel exhausted” messages in the console coming from Unity. I didn’t look much more into the issue, but the issue did indeed seem to be correlated with the number of audio sources playing sounds in my game (there can be more than 100).

How to test on iOS

1 Like

Has anyone managed to test this out. Upgrading to beta iOS is a bit of a pain. It will be a few days before I am able to try myself.

Does it work? Is performance improved in anyway?

Any idea when WebGL 2 goes live in main safari (non preview)?