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
Maks Michalski

I've noticed this issue when rendering discs in immediate mode in 2021.2.9f1. None of the suggestions had helped, but strangely if i add a disc component to the scene (even disabled) all starts to work normally, which is an acceptable workaround for now. Hope that info helps.

Avatar
James Moulang

I had this issue on Android, in Unity 2020.3.32f1, specifically with rectangles with rounded corners (immediate mode only) - a Shapes reinstall fixed my issue (after a lot of shaders rebuilt)

Avatar
Thomas Brown

I just had an issue where turning off GPU Instancing also resolved my issue despite the tested devices supporting GPU Instancing.

I have a feeling this was linked to the way I was possibly animating my ImmediateMode shapes. I was dynamically creating an object and within said object I was animating properties of the object using DOTween. From there I was drawing my shapes with the given properties using the Draw command.

Because the above is pretty vague without my code I'll go ahead and add it below.

Interaction Ring Code

This was with the following setup
Unity: 
2018.4.30f1
Render Pipeline: Built In
Platforms:
Android & iOS

Avatar
b toqq

I also attached the Frame Debugger both to the (working) M1 build and the (not working) iphone build.

Notably - the iPhone build completely lacks the "Draw mesh (instanced)" draw calls in the command buffer.

Avatar
b toqq

Hi - I can add to this - the same iOS build I use (2020.3.24 on blank URP project) works correctly both in editor and in standalone build on on M1 Mac Mini. I can see no issues there.

On the iPhone, I noticed it defaulted to "medium" graphics quality, and M1 defaults to "high". I set the iPhone build to high also, but still the issue persists.

Also, I manually made sure that the shaders are in the shadervariants file, and added to the build. I also added a manual line in the scene just to ensure the shader would be noticed by Unity.

Still, no change - the line I added through the scene is visible but the Immediate mode lines are not.

No error or warnings beyond what I posted earlier.