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:

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.

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
Freya Holmér
  • 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

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

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