The sample scene probably isn’t a good testbed for mobile performance. You may want to check if there are any post-processing effects (I think Bloom is enabled which is pretty heavy for mobile) and disable them so you just get the geometry performance.
Anyway, don’t expect WebGL to perform well on mobile, at least not anywhere close to the same content in a native app. While you’re at it, this is something you could try: make a regular iOS build for comparison. Then you have a performance baseline to see what would be possible, and how much WebGL performance sucks.
I found that UniversalRP-LowQuality has no performance problem, the problem only exists in Mid and High.
By comparing the three configurations one by one, it is found that Lighting-Additional Lights will greatly affect the performance. On the iPhone 13, if PerPixel is selected, the frame rate will drop to 10fps. And PerVertex can reach 60fps.
Modifed UniversalRP-MediumQuality to find the difference.
It’s OK:
“drawElements” is the draw call submitted to WebGL, so the performance issue is in the WebGL browser implementation. There is a known issue with the Metal backend of WebGL, which iOS 15 is using, that causes performance issues. It’s related to shaders and uniform buffers. Apple and Google are working on it.
An equivalent scene in WebGL that doesn’t use uniform buffers gets to 60FPS, whereas the Unity one only reaches 6-10FPS. I think it’s a bug - mobile GPUs have their limitations (they generally hate fullscreen effects) but they’re plenty fast enough for many things.
@TLuthDidimo I’m guessing this is probably the known Apple WebGL bug on iOS where larger uniform buffers can cause drastic performance issues. Apple and Google have been working on a solution, but it’s taking them a long time because they’ve had limited resources. I certainly hope they can get to it soon.