Search Unity

[Released] Draw XXL

Discussion in 'Assets and Asset Store' started by DanielK2, Mar 27, 2023.

  1. DanielK2

    DanielK2

    Joined:
    Jul 17, 2017
    Posts:
    13
    Hi everyone,

    this is the official support thread of the Draw XXL asset. Draw XXL is an extensive set of visual debugging and development tools. It can be used as components without any code or like debug lines as one-line-calls from anywhere in your code.

    Feel free to ask any questions.









































     
    Last edited: Mar 28, 2023
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,500
    This looks really, really good!

    Congratulations on the release.
     
    xiangshushu likes this.
  3. mgear

    mgear

    Joined:
    Aug 3, 2010
    Posts:
    9,448
    Jerome_V and ina like this.
  4. DanielK2

    DanielK2

    Joined:
    Jul 17, 2017
    Posts:
    13
    Hi mgear,
    sorry I was so busy around the release that I even forgot to link the store entry in the thread. Fixed it now.
    All lines are drawn with Unitys build-in ways. The default is via Debug.DrawLine(). In Edit mode it is via Gizmos.DrawLine(). In builds it is via a mesh with "mesh topology = lines". I tried it in all render pipelines and it works.
    Concerning VR: I'm not an expert in VR and don't know the special requirements for it. But since it is just a mesh it should work, am I right?
    Here is some more detail on how the different line drawing methods are chosen from the documentation.
     
    Jerome_V and mgear like this.
  5. ina

    ina

    Joined:
    Nov 15, 2010
    Posts:
    1,085
    i wonder about the draw calls to using this in runtime for VR vs using shapes or something more performant
     
    DragonCoder likes this.
  6. Jerome_V

    Jerome_V

    Joined:
    Oct 21, 2016
    Posts:
    42
    I'm interested in purchasing this asset. I would like to know if this tool would work outside the editor as well (i.e. in builds and/or animations).

    I would like to use this for demonstration/simulation/visualisation purposes outside the Unity editor. Not as a debugging tool, but as an overlay over animations to show realtime data like in a documentary where they analyse a certain event by overlaying data on top of a slow motion animation (for instance showing the speed and trajectory of a moving object in 3D space with overlayed text, arrows, etcetera). Would this be possible in a standalone build outside the Unity editor?

    Thanks in advance for your answer.
    Your asset looks great!
     
  7. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    @Jerome_V it says on their asset store page "Works in Edit Mode, Play Mode and in builds" so i'm pretty confident answering.. yes, it will work :)
     
    Jerome_V likes this.
  8. DanielK2

    DanielK2

    Joined:
    Jul 17, 2017
    Posts:
    13
    Hi Ina,

    I think the draw calls shouldn’t be a problem. In builds it is drawing with a mesh, that means all drawn lines are combined into a single Gameobject with a mesh. That is, there should be only one additional draw call. But it is using sub meshes. Each ca. 65000 lines create a new sub mesh. I just learned from this thread here ( https://discussions.unity.com/t/submeshes-increase-draw-calls-any-way-around-this/56897/2 ) that sub meshes can create additional draw calls. But at least it is using the same material for the sub meshes so we could be lucky and it stays at only one draw call. And anyway: It will not be many submeshes (since each one can carry up to ca. 65000 lines).

    Having that said: Draw calls shouldn’t make a performance problem here, but anyway don’t expect too much on the performance side from this asset. It is mainly intended for debugging and not optimized for performance. I think the bottleneck for performance is not the drawcalls but that all of the possible thousands of lines get filled into the mesh each frame.
     
  9. DanielK2

    DanielK2

    Joined:
    Jul 17, 2017
    Posts:
    13
    Hi Jerome_V,

    interesting use case. So first: As Adamgolden already correctly said: Yes, it works in builds.

    As far as I understood you it should be possible to achieve what you described with the asset. The only thing is: Yes, it works in builds, but there might be some performance hit (depending on how much you draw).
     
    Jerome_V likes this.
  10. Jerome_V

    Jerome_V

    Joined:
    Oct 21, 2016
    Posts:
    42
    Thank you for your answer! I read the same info on the product page in the asset store, but I still have many questions about the drawing process for builds. DanielK2 did answer mgear's question about the asset's use outside the editor, but I would love to have more detailed info from him about the conversion of these drawn lines to a mesh for use in builds.

    Specifically, I'd like to know how the mesh containing those debug lines, arrows, text, numbers, etcetera gets updated dynamically. For instance, let's say you have a new build of a racing game for Android, with all the lines & text/numbers showing information about the car/gameobject controlled by the player all contained in a mesh. Does the data in that mesh get updated automatically following the player's input, the changing of the camera perspective, the angles of the game object, it's changing position in 3D space, during animations of the game object, etcetera, just like it would do in a regular debug process inside the editor?

    In other words, does the line data in the mesh get updated dynamically in real time, like a simple name tag on the cars of the player's opponents during an online multiplayer race that shows their changing place/position, speed, relative distance, etcetera?

    I would appreciate any additional information on this "mesh topology = lines" option in builds. Thanks!
     
  11. Jerome_V

    Jerome_V

    Joined:
    Oct 21, 2016
    Posts:
    42
    I was typing my previous post when you posted your answer. Thanks a lot for your reply!

    I would like to use your asset in interactive simulations of accurate/meticulous reconstructions of historical events for the purpose of education and academic research. Your asset seems to be just the right tool for the job. I think the performance of such a dynamic, interactive simulation could be managed by only showing data relative to the player's perspective, similar to LODs in large open world game environments.
     
  12. jimmying

    jimmying

    Joined:
    Sep 20, 2017
    Posts:
    107
    Hi @DanielK2 I've got a minor issue where the Text Drawer inspector in the editor seems to always expand itself either when entering play mode or when moving away from the selected game object and then coming back to it.

    e.g. in editor have a game object with a Text Drawer component attached selected; collapse the component; enter play mode; the Text Drawer component expands.

    I'm on 2021.3.26f1.

    Thank you
     
  13. DavidHoogenbosch

    DavidHoogenbosch

    Joined:
    Aug 28, 2020
    Posts:
    2
    Hi Daniel.

    I am using DrawXXL to draw measurements and other readouts, both in the editor and at runtime.

    There is a difference in how the DrawXXL behaves with regards to the duration.
    In the editor the statement
    DrawBasics.Line(_startPoint, _endPoint, text: "tooltipText");

    Draws a line for one frame.
    At runtime the line lasts until another is drawn.

    In the editor this limited duration text lasts until the duration is over.
    DrawXXL.DrawText.Write("text", position: worldPosition, size:20, durationInSec:5f);


    At runtime the same code lasts until I draw new text.

    How should I make the drawings behave the same way?

    Thanks in advance.