Multiple discs wont draw in an Immediate Mode loop

Avatar
  • updated
  • Under Review

I'm using Shapes Immediate Mode in URP to draw polygons and draw discs on the points of those polygons. In Unity 2020.3.10 this functionality worked, but my team has updated to 2021.1.10 and now only the first point in a shape gets its disc drawn - adding any more shapes causes no discs at all to be drawn. I've tested with different color and alpha values and the result is the same.

I've also debugged out all of my data so there are multiple points there to be drawn when I'm expecting it to, so I think it's something to do with Shapes and the latest version of URP.

Also, multiple Polygon shapes are drawn flawlessly - it just seems to be these specific looped discs.

Here's the logic:

Image 441

Thanks in advance for any support, and thanks for making an amazing tool!

Reporting a bug? please specify Unity version:
2021.1.10
Reporting a bug? please specify Shapes version:
3.2.3
Reporting a bug? please specify Render Pipeline:
URP
Avatar
Freya Holmér creator
  • Under Review

sounds like it's GPU instancing or shader related!


  1. make sure your project supports GPU instancing. I think URP might have some setting that will force it off in favor of the SRP batcher
  2. you can check if it's instancing related by turning off GPU instancing in the Shapes settings window. It will very likely start working as soon as you turn it off, but, ideally it should of course be on!
  3. try doing a clean install of Shapes

let me know if it makes a difference!

Avatar
Tom Kail

We also had this problem - except with lines! It was working fine for weeks, until I noticed it wasn't - "Regenerate Shaders and Materials" in the Shapes Settings fixed it for us!

Avatar
dom

Thanks! Disabling GPU instancing on Shapes did it! however re-enabling it and disabling the SRP batcher didn't fix it. Also had no luck with regenerating the shaders/materials

Avatar
Freya Holmér creator
Quote from dom

Thanks! Disabling GPU instancing on Shapes did it! however re-enabling it and disabling the SRP batcher didn't fix it. Also had no luck with regenerating the shaders/materials

you should be able to leave it on though - did you try a clean reinstall?

Avatar
dom
Quote from Freya Holmér

you should be able to leave it on though - did you try a clean reinstall?

sorry for the late reply, but I did a clean reinstall, updated to the latest, and it didn't help this im afraid /:

Avatar
Freya Holmér creator

4.1.0 has now been submitted to the asset store - can you try it again once you see the update on your end? :)

Avatar
dom
Quote from Freya Holmér

4.1.0 has now been submitted to the asset store - can you try it again once you see the update on your end? :)

I gave it a shot and it didn't seem to fix it - if I'm the only one experiencing this after trying the above I'm wondering if it's an implementation problem? Not sure what I could've done wrong though.

Avatar
Freya Holmér creator

do you have a more minimal repro case?

Avatar
Grant Davies

Just wanted to chime in and say I'm experiencing something that sounds very similar. In immediate mode, I can draw any number of lines and a single disc, but as soon as I draw more than one disc, all discs disappear (the lines continue to render).

Disabling GPU instancing resolves the issue - all discs appear when I toggle that option off. I can toggle GPU instancing on and off and the discs will appear and disappear.

Unity 2021.2.0b2.3053
Shapes 4.1.0

Default render pipeline

I'm using this code:

Fantastic asset, thank you for making it!

Avatar
Freya Holmér creator

It might be worth deleting the shader cache in the Library/ folder, or do a full clean reinstall when this happens. some people have reported that this makes it work for them, so it's worth a try!

https://shapes.userecho.com/en/knowledge-bases/2/articles/383-when-shapes-doesnt-render-in-builds