GPU Instancing issue in WebGL builds

Avatar
  • updated
  • Unity's Fault

Hi,

I wrote you an email yesterday about the bug that I found, but since I had some time, I also made a small repro project. https://github.com/LanceTreiber/ShapesBug1

- add the Shapes assets

- Run it - the controls are: RMB to pan, Mouse wheel to Zoom Out

I'm simply spawning a 1000 prefabs with a Rectangle on Start, and it works fine in Editor, but it's buggy in WebGL builds.

In Editor, you get a staircase:

Image 405

Same build in WebGL: most rects aren't displayed. When I had more intricate stuff in my full project, rects sometimes displayed in wrong sizes or could take up the entire world. It's just wonky.

Image 406

Turning off GPU instancing on the rectangles fixes it, but produces low FPS for obvious reasons.

Reporting a bug? please specify Unity version:
Tried it both in the latest 2019 and 2020
Reporting a bug? please specify Shapes version:
Tried both Shapes 2 and 3
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
lance treiber
Quote from Freya Holmér

..what do they mean? caused by Shapes how? like if it works on all other platforms just fine then it sounds like a Unity or browser bug to me ;-;

Yes, it doesn't appear to make much sense. They should've at least mentioned how they arrived at that conclusion.

Anyway, I tried webgl1 and it works just fine. By the time they decide to deprecate it, I hope they'll inadvertently fix the issue.

Avatar
Freya Holmér creator

..what do they mean? caused by Shapes how? like if it works on all other platforms just fine then it sounds like a Unity or browser bug to me ;-;

Avatar
lance treiber

Hey, so an update on the situation.

Initially they accepted my bug report, replicated it in some browsers and even assigned it an ID. Then a week later, they posted this:

"Upon further investigation it seems like this issue
is caused by the Shapes package. Unfortunately it is a 3rd party
package and currently, Unity does not support 3rd party packages, thus,
we recommend contacting the developer of that package for further
assistance."

I might as well share the case link: https://fogbugz.unity3d.com/default.asp?1339928_afs47oct93d3llfh

I'm unsure about what to do now...

Avatar
Freya Holmér creator

thanks, hope it works out, and sorry for the inconvenience!

Avatar
lance treiber
Quote from Freya Holmér

have you tried different browsers? this seems like it's potentially the same bug as here, which turned out to be Unity's fault, but then turned out to be google's fault for chrome specifically

https://shapes.userecho.com/en/communities/1/topics/182-webgl-incorrect-polygon-and-disc-fill-color

I naturally tried Firefox and Chrome, the two major engines on Windows.

But now that you mentioned it, I decided to be exhaustive and tried Edge, even though it uses the same engine as Chrome. And shockingly, it works in Edge. Wow.

So I guess we can rule out that it's a Shapes bug. Major issue, though. I'll try to report it to Unity. I don't know their policy regarding bug reports with third party plugins, but they seemed to accept the report that you linked, so fingers crossed. I'll post a link to the issue here.

Avatar
Freya Holmér creator
  • Unity's Fault

have you tried different browsers? this seems like it's potentially the same bug as here, which turned out to be Unity's fault, but then turned out to be google's fault for chrome specifically

https://shapes.userecho.com/en/communities/1/topics/182-webgl-incorrect-polygon-and-disc-fill-color