ImmediateModeShapeDrawer not drawing duplicated shapes

Avatar
  • updated

Hi,

I'm trying to wrap shapes into a ShapesManager, child of ImmediateModeShapesDrawer.
I noticed that drawing twice the same type of shape in the command makes that shape not drawing at all.

Here's the code I used to debug my manager : 

Image 566

Here's the result in play mode (spheres not drawing): 

Image 567

And here's the result when I remove line 52 (working as expected for L50-51): 

Image 568


To explain a bit the Manager outside of my debug : 
The manager receive gizmos from the code 
the "gizmos" used are Actions calling Draw's methods

So I have one Command drawing all the needed shapes
(not sorted yet for batching)

Reporting a bug? please specify Unity version:
2021.2.0f1
Reporting a bug? please specify Shapes version:
4.1.1
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Avatar
robin roekens

Tried with URP, the issues isn't there but I wonder why it happened in Build-in 

Avatar
Freya Holmér creator

whenever it doesn't draw when putting two draw calls in a row, it means GPU instancing is broken, somehow.

I would try a clean reinstall, quite often shader issues like this are caused by updating in place or just, weird Unity magic

Avatar
robin roekens
Quote from Freya Holmér

whenever it doesn't draw when putting two draw calls in a row, it means GPU instancing is broken, somehow.

I would try a clean reinstall, quite often shader issues like this are caused by updating in place or just, weird Unity magic

Ok thank you for your answer.