Hi! I have an existing project that I updated to use the URP in Unity 2021.3.23f1. For the most part, I started with the SampleScene in the Unity Hub URP template and just added my existing scene content. I didn’t add additional lighting or post-processing effects or anything new. I then made a WebGL 2.0 build and tested it in browsers. It works fine on Windows machines in Chrome and Firefox. However, on both iOS 15.6.1 and macOS 13.3.1 the WebGL build does not properly render in either Chrome or Safari. There are strange black lines and render patterns across many of the surfaces.
I then tried making a brand new 3D URP project using the Unity Hub template. I added 9 cubes to the SampleScene that each use the URP Lit shader and made no other additions or changes to the project (other than removing WebGL 1.0 and Brotli compression from the build settings). I see the same problem when I run this in Chrome or Safari on macOS or iOS. I see strange black patterns on the cube surfaces.
Here is the above running on my site where I see the render issues on Mac and iOS: https://team2bit.com/test/
Am I missing something obvious? Should a WebGL build of a simple URP project run properly on macOS and iOS? Or is there some initial setting that I need to modify or change? I’m kind of shocked that this doesn’t work out of the box. Have other got this to work? Is it potentially tied to my Unity version? Any help is greatly appreciated!
There have been reports about this distortion issues with Safari and in particular with the new M1 macs. If there was a solution it should be in one of the threads in this forum. I vaguely remember something about changing some setting but it may just have been a recommendation, not a fix.
It may just be one of those Apple+WebGL issues which I attribute to Apple possibly deliberately deprioritizing WebGL because it is threatening their walled garden business.
One thing I would strongly recommend with WebGL is to try out 2022.2 and even 2023.1 beta given that you already have a test project. Because WebGL tech is frequently undertaking under the hood improvements.
I was able to revert to a non-URP project, import the post-processing effects package, set up the same post-processing features, export a WebGL build and it ran properly in Safari and Chrome on a Mac and on iOS. It seems to be tied to the URP or some default setting that is part of the Unity Hub template.
I’ll likely try 2022 and 2023 at some point, but for now it looks like the URP just isn’t “universal” enough to meet our project needs. I hate reverting to old ways of doing things, but we need this project to run in a browser.
You found one solution but that doesn‘t mean it‘s the only one. And it‘s a pretty grim one because it‘ll be far less performant. Unless you are hard pressed for time I‘d play with some of the urp, graphics, quality, player and specifically lightmap/shadow settings to see if there‘s an easier workaround.
And let‘s not forget, Apple has a long history of [undersupporting WebGL and taking an unfair amount of time to fix issues on their end]( iOS 15 + WebGL 2 issue page-2#post-8001036). And [also this post]( iOS 15 + WebGL 2 issue page-2#post-8061206). That same thread has a number of tips and potential workarounds you could try.
I run into this bug too and opened an issue on unity tracker in June '23.
No update till now, but you can go there and vote the issue to raise awareness: