Gizmo Optimization / Performance Improvements

Unity Version: 2020.2.0b7.3288

I’m generating lots of ray casts, storing that data, and viewing the contact points as spheres, and the initial cast as a line.

Scene view seems to still lag when showing lots of lines and spheres.

I can look into other ways of presenting this data, but just thought I’d give a heads up.

Hi @eolson ,

Was performance for this better in previous versions? If so, did you already submit a bug report for it?

Performance seemed the same as it was on previous versions, nothing seemed to improve. I’ve tried the same exact scenario on 2019.4 and this version, with no gains.

I just mention this because I saw in the 2020.2 blog post it was mentioned that gizmos performance were improved.

Thanks for the context. Did you have a chance to profile this yet? If there’s no improvement to gizmo rendering times, it would be great if you could send over a reproducible via a bug report so we can have a look.

To recreate just loop through and generate lots of sphere gizmos at random points. I’ll try and profile later today.

Not necessarily “all” gizmo scenarios have seen performance improvements. Particularly what should be faster:

  • Gizmos where there’s a lot of different gizmos rendered at once (i.e. different colors, gizmo types, etc.); the sorting & batching of those was optimized.
  • Gizmos that are so small on screen that they can be skipped from rendering (or outside of screen completely) are faster now.

Your particular case may or might not see performance improvements – a profiler data capture (or an exact scene you’re testing) as a bug report would be helpful.

Good to know, thank you! I can’t send the exact scene sadly, but when I have time I’ll try and take a profile capture.