Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

New Gizmos in Alpha 9 are great

Discussion in '2020.2 Beta' started by CDF, Apr 30, 2020.

  1. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    From the Release Notes:
    Just wanted to drop in and say thank you for improving the transform gizmos.
    No more frustrating axis selection. It's working great.

    I got a good feeling about 2020.2 :D
     
  2. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    There are so many small things that it becomes such a big deal.
    I wish they really eat their own dog food one day.
     
    IOU_RAY and phobos2077 like this.
  3. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Yay thanks!
     
  4. SugoiDev

    SugoiDev

    Joined:
    Mar 27, 2013
    Posts:
    395
    "eat your own dog food" means using Unity to build stuff, in this context. Like Unreal that builds games using Unreal, or Plastic SCM developers that use Plastic SCM to develop it.

    I'm super appreciative of all the development that is going on, especially with editor performance. I just popped here to clear that up because it sounds much worse than it actually is.
     
  5. chrisk

    chrisk

    Joined:
    Jan 23, 2009
    Posts:
    704
    Hey, Aras, If you are up for it, how about adding an automatic animation play option to the Animation Preview window for an instance? It should be a 5-minute job for you that can save huge pain in the butt.

    Yeah SugoiDev, This is just an example of what I mean by eating your own dog food, something that you would have discovered years ago if you are using your own tools.
     
    phobos2077 and DeoSsin like this.
  6. Onigiri

    Onigiri

    Joined:
    Aug 10, 2014
    Posts:
    486
    Add MSAA to gizmos pleeeaase:oops:
     
  7. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    That would require scene view to have MSAA (and it used to at some point in the past, but not anymore, I'm not sure why - will investigate). Or, render gizmos with some "manual" anti-aliasing in the shader(s) that would not rely on MSAA, which is also on the todo list to look at. The todo list is fairly long though :)
     
    Baste and Lars-Steenhoff like this.
  8. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    phobos2077 likes this.
  9. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Nice blog!

    That's really cool - as you say resolutions have got to the point where it's hard to see single pixel lines now. I have to squint to see my Debug.DrawLines.

    This is a great feature. I wonder, is it going to be possible to draw these handles inline with bursted job code in the future?

    It would be really nice to just be able to do a DebugDrawLineWithThickness () style function exactly where the data I want to draw with is.
     
  10. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    how to stop gizmos crashing unity?
     
  11. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    How/what crashes? Filing a bug report would be one way.
     
  12. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    Is "optimizing gizmos" on the same list?

    Drawing n cube gizmos in the scene view is several orders of magnitude slower than drawing n cube gameobjects. I'm guessing that gizmos uses some kind of immediate mode rendering that simply doesn't scale. They're also very clearly not culled by the scene view camera, since if I cull gizmos manually I can notice a pretty significant speedup.
     
  13. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Yes.
     
    Prodigga and Baste like this.
  14. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    And chance OnDrawGizmo get anything? Like 2D gizmos?
     
  15. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Not sure I understand the request. Can you elaborate?
     
  16. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    @Aras

    1) Is it ever going to be possible to simply Gizmos.DrawLine (and other Gizmo functions) in a bursted job or a non-bursted job or at least outside of a OnDrawGizmos function?

    2) Why can't we use Gizmos in standalone builds if we want to? Even if it's only a Development standalone build.
     
  17. Aras

    Aras

    Unity Technologies

    Joined:
    Nov 7, 2005
    Posts:
    4,770
    Yeah, that's because Handles, Gizmos, Debug.Draw are, uhm... "not that great" designed APIs. The idea at some point was, I think, that Handles is "things one can interact with", Gizmos is, well, for non-interactive parts of things visualized in the editor, and Debug.DrawLine would be for debugging functionality that also works in game (and it does). But all of that was designed a decade before things like "C# jobs" existed, and e.g. Debug.DrawLine is just that, without any extra things like ability to draw circles, text labels, etc.

    Making all of that mess "somewhat better" (also taking into account C# jobs etc.) is on someone's todo list, yes. But again, don't know when exactly that will happen.
     
    phobos2077 likes this.
  18. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    Just like a circle/disc, rectangle, triangle options in Gizmos. Something more 2D specific than the cube and sphere we already have. (i guess i'm just asking if more Gizmos options will ever be coming)

    Also is text a possibility for Gizmos?
     
    Last edited: May 7, 2020
  19. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    I just hope a new API is created from scratch instead of trying to fix the old ones.
     
  20. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    If you want to draw text when you're drawing Gizmos, you'll need to use Handles.Label

    Which is... not great! It's very bad at not being on the screen when it's outside the view frustrum. It's also, unlike Gizmos, Editor only, so you have to #if it out.


    The ideal world would be if we could have something like Handles.BeginGUI, but with a transform matrix/plane/whatever to define world space position. Alternatively a way to feed it UI Toolkit stuff.
     
  21. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,338
    @JoNax97, meh, Unity generally does too much "let's make a new and better version". Gizmos has a comfortable interface, and is very good at what it does, it's just slow and lacks good text handling.
     
    phobos2077 likes this.
  22. Ofx360

    Ofx360

    Joined:
    Apr 30, 2013
    Posts:
    155
    Wait, Handles works in OnDrawGizmos?
     
  23. JoNax97

    JoNax97

    Joined:
    Feb 4, 2016
    Posts:
    611
    I was thinking about a feature rich debug/tooling C# API that lives in the new Unity.* family of namespaces, that can be safely called from jobs and that can be extended as necessary and supports, like you said, UIElements. I think there's no point on touching the current ones except if a QOL fix is a low hanging fruit.
     
  24. CDF

    CDF

    Joined:
    Sep 14, 2013
    Posts:
    1,311
    Something that would be immediately beneficial is a GizmoDrawingScope :D
    Just like Handles.DrawingScope

    You can, just wrap the Handles code in #if UNITY_EDITOR
     
    phobos2077 likes this.
  25. jdtec

    jdtec

    Joined:
    Oct 25, 2017
    Posts:
    302
    Ah I see.

    I guess this explains why internal Unity projects like the DOTS FPS have their own functions for some of this stuff.

    Maybe I'll have to write my own jobs and burst capable debug draw library.
     
  26. jamespaterson

    jamespaterson

    Joined:
    Jun 19, 2018
    Posts:
    401
    Many thanks to aras! Usability improvements are much appreciated.
     
    phobos2077 likes this.
  27. radiantboy

    radiantboy

    Joined:
    Nov 21, 2012
    Posts:
    1,633
    Lol man not been able to submit a bug report since 2015.. i just found out the hub can do one and it works, i desperately need gizmo bugs to be fixed, all u need to do is list what app is creating the gizmos in the log! Something reboots unity, probably old but I have no ideas what, soon as u tap gizmos unity dies. After 1 yr I do have a buig report submitted.