Shapes not rendering in builds (investigation megathread)

Avatar
  • updated

I'm getting reports of Shapes not rendering when building for certain platforms, and unfortunately I don't know why this keeps happening. There seems to be some cases where GPU instancing doesn't work, even though I've set everything up correctly on my end (as far as I know), and even though the platforms you test on, should support GPU instancing.

This thread will serve as a centralized discussion thread on this issue, as they are likely all related.

It seems like it only happens when GPU instancing is on (correct me if I'm wrong!), which means that somehow GPU instancing is either not supported, or not working even though the platform should support it. This could be due to any number of things, such as, the platform misreporting instancing support, or a plugin disabling instancing silently, or a render pipeline configuration that silently suppresses GPU instancing.

However, GPU instancing is the primary way Shapes makes itself performant, you shouldn't have to disable it.

I would start by testing a few things to investigate further:

  1. Do a clean reinstall of Shapes, and see if you still have issues. This is very important to do before reporting any bugs in general. The package manager and Unity in general often struggle to update assets cleanly, so you may have cached files in a broken state, which often leads to weird issues like this. We have multiple reports [1] [2] [3] of clean reinstalls solving this issue
  2. Please check for any build or runtime logs for warnings/errors related to Shapes or shaders
  3. If you are using immediate mode rendering in Shapes, try disabling immediate mode GPU instancing in the Shapes settings window, and then see if it works. If it works after this, we know that it's related to GPU instancing. If it still doesn't work, then let me know!
  4. Unity has a way to check if your current platform actually supports GPU instancing, I would run this on your target platform to double check that it is actually supported.
  5. Make sure all shader instancing variants are included in your graphics settings. Unity can't predict which shaders you will use in immediate mode, and so it will sometimes strip them from builds


other than that I'm at as much of a loss as you are - I've implemented instancing support the way one should, it works just fine on many platforms, including iOS and Android for many, so I don't know why it seems to fail in some specific cases. There might be some hidden setting somewhere that disables GPU instancing elsewhere, though that's something I wouldn't know of

Do let me know if you find something out that might help us resolve this!

Reported issues:

Target platformUnity versionRender PipelineInstancing off works?
iOS (iPhone 13 pro)2020.3.24URPyes
Android/iOS2021.2.0 & 2020.3.5URPyes
M1 mac mini???
WebGL in chrome2019 & 2020Built-inyes
WebGL 2.02019.4.12??
WebGL 2.02019.3.0
2020.1.3
2020.1.11
2020.2.13
Built-in?
Editor2021.2.0Built-inyes
Editor2021.1.10URPyes

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
peter roth

The clean install worked for me. WebGL Build.
-Flat
2DLines were not working unless GPU instancing was turned off. --> After a clean install, they do!

-I did a clean install according to the instructions (more than just deleting and reinstalling the shapes package must delete Library to force a reimport...see Freya's instructions: 

Avatar
Trevor G

Here's my saga with a happy ending...(using 2021.3.6f1 (LTS) and Shapes 4.3.1).

1.  Everything worked in the Editor with GPU Instancing On (except Draw.Texture, single Texture would render, but if I called Draw.Texture twice, nothing would render)

2. On Build, about half the Draw Commands worked (with and without GPU Instancing).  

3. I deleted my ShaderCache and PlayerCache folders from Library as suggested in an earlier post.

4. Now the Editor looked like how previous builds did (about half the lines being rendered).  However, with GPU instancing OFF, everything worked in the Editor AND Build (good enough).

5.  I tried to do a clean install, but deleting the Library folder caused lots of problems in my project (elsewhere), so I backed off that.

6.  I was randomly trying some things...In the Settings, I changed the "Local AA Quality" from HIGH to MEDIUM.  Now, everything renders correctly in Editor/Build with or without GPU Instancing.  YAY!

7.  I also had an issue rendering textures...feeling lucky, I changed the "Quad Interpolation Quality" from MEDIUM to LOW and this fixed my Texture issue as well (In Editor And Build with and without GPU instancing. Double YAY!

Hopefully there's something helpful in that chaos.

Avatar
edvard rutström
Quote from Trevor G

Here's my saga with a happy ending...(using 2021.3.6f1 (LTS) and Shapes 4.3.1).

1.  Everything worked in the Editor with GPU Instancing On (except Draw.Texture, single Texture would render, but if I called Draw.Texture twice, nothing would render)

2. On Build, about half the Draw Commands worked (with and without GPU Instancing).  

3. I deleted my ShaderCache and PlayerCache folders from Library as suggested in an earlier post.

4. Now the Editor looked like how previous builds did (about half the lines being rendered).  However, with GPU instancing OFF, everything worked in the Editor AND Build (good enough).

5.  I tried to do a clean install, but deleting the Library folder caused lots of problems in my project (elsewhere), so I backed off that.

6.  I was randomly trying some things...In the Settings, I changed the "Local AA Quality" from HIGH to MEDIUM.  Now, everything renders correctly in Editor/Build with or without GPU Instancing.  YAY!

7.  I also had an issue rendering textures...feeling lucky, I changed the "Quad Interpolation Quality" from MEDIUM to LOW and this fixed my Texture issue as well (In Editor And Build with and without GPU instancing. Double YAY!

Hopefully there's something helpful in that chaos.

I can confirm that 6. above helped us with the GPU instancing issue. GPU instancing is working properly in the rest of the game, so this might be a lead?

Best of luck, and thanks for a really great plugin!