Immediate Mode displays one torus, not two

Avatar
  • updated
  • Not a bug

I didn't find a more explicit title, but let me explain. 
I have the following code attached to a GameObject:

[ExecuteAlways]
public class CommandWidget : ImmediateModeShapeDrawer
{
[Range(0, 360)]
public float yaw = 0;
public override void DrawShapes(Camera cam)
{
using (Draw.Command(cam))
{
Draw.Matrix = transform.localToWorldMatrix;
Draw.TorusRadiusSpace = ThicknessSpace.Pixels;
Draw.TorusThicknessSpace = ThicknessSpace.Pixels;

Draw.Torus(Vector3.zero, Vector3.up, 100, 2, Color.cyan);
Draw.Torus(Vector3.zero,
Quaternion.AngleAxis(90+yaw, Vector3.up),
100,
2,
Color.green);
}
}
}

This doesn't draw anything. But if I comment one of the Draw.Torus calls, the other is executed properly. 

I feel like this is a bug, but maybe I did something wrong :)

Reporting a bug? please specify Unity version:
2020.3.3f1
Reporting a bug? please specify Shapes version:
3.2.3
Reporting a bug? please specify Render Pipeline:
Built-in render pipeline
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Not a bug

seems to work fine for me. does turning immediate mode instancing on/off in the Shapes settings make a difference?

It could also be a broken Shapes installation. To do a clean install:

  1. Delete the Shapes folder
  2. Close Unity
  3. Delete Unity's Library folder (this will force reimport everything)
  4. Open Unity (might take a while to reimport it all)
  5. Install Shapes from the asset store

Avatar
Guilhem Brouat

I finally had the time to try the reinstall procedure you proposed, and it worked! Thanks 👍

Avatar
Guilhem Brouat

Thanks for the answer! 
Indeed turning off GPU instancing makes it work. 
I will try to do a clean install...

Avatar
Freya Holmér creator
  • Answer
  • Not a bug

seems to work fine for me. does turning immediate mode instancing on/off in the Shapes settings make a difference?

It could also be a broken Shapes installation. To do a clean install:

  1. Delete the Shapes folder
  2. Close Unity
  3. Delete Unity's Library folder (this will force reimport everything)
  4. Open Unity (might take a while to reimport it all)
  5. Install Shapes from the asset store