Is it possible to use Shaped for rendering many debug helpers?

Avatar
  • updated
  • Answered

I need to draw many helpers in my scene, when some GO are selected, currently i'm using mosty draw gizmos of sphere and lines,
Is it possible to use shaped to draw many debug helpers using code, and get good performance (not immediate mode)?
I have many possible spawn points and area's in the scene, and would like to easily visualize them. gizmo's are slow and doesn't provide interesting options.

Reporting a bug? please specify Unity version:
Reporting a bug? please specify Shapes version:
Reporting a bug? please specify Render Pipeline:
Pinned replies
Avatar
Freya Holmér creator
  • Answer
  • Answered

Currently you'll generally have to use immediate mode if you want to draw gizmos with shapes. It should be performant for most use cases, but there's always a limit of course. Not using immediate mode would be harder, as you'd have to spawn game objects and then destroy them, which has some management overhead to it as well which would likely cause hitches on select/deselect

so yeah, immediate mode in OnDrawGizmos would be your best bet!

Avatar
Freya Holmér creator
  • Answer
  • Answered

Currently you'll generally have to use immediate mode if you want to draw gizmos with shapes. It should be performant for most use cases, but there's always a limit of course. Not using immediate mode would be harder, as you'd have to spawn game objects and then destroy them, which has some management overhead to it as well which would likely cause hitches on select/deselect

so yeah, immediate mode in OnDrawGizmos would be your best bet!