Search Unity

Official Introducing the Vector API in Unity 2022.1

Discussion in 'UI Toolkit' started by SimonDufour, Dec 10, 2021.

  1. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    This will be a brief overview of the new UI Toolkit Vector API that recently landed in Unity 2022.1

    First, a bit of (mesh generation) context:
    UI Toolkit already provides the Mesh API which allows drawing custom content into a VisualElement. However, while everything is possible, it is hard to use. The code required to generate a single quad has to allocate vertices and indices, and provide coordinates in a clockwise direction. There is a few way it could not work as expected and it not the easiest thing to debug.
    Code (CSharp):
    1. void OnGenerateVisualContent(MeshGenerationContext mgc)
    2.             {
    3.         var mesh = mgc.Allocate(4, 6);
    4.         mesh.SetNextVertex(new Vertex() { position = new Vector3(p0.x, p0.y, Vertex.nearZ), tint = wireColor});
    5.         mesh.SetNextVertex(new Vertex() { position = new Vector3(p1.x, p1.y, Vertex.nearZ), tint = wireColor});
    6.         mesh.SetNextVertex(new Vertex() { position = new Vector3(p2.x, p2.y, Vertex.nearZ), tint = wireColor});
    7.         mesh.SetNextVertex(new Vertex() { position = new Vector3(p3.x, p3.y, Vertex.nearZ), tint = wireColor});
    8.  
    9.         mesh.SetNextIndex(0);
    10.         mesh.SetNextIndex(1);
    11.         mesh.SetNextIndex(2);
    12.         mesh.SetNextIndex(0);
    13.         mesh.SetNextIndex(2);
    14.         mesh.SetNextIndex(3);
    15.             }
    Overall, this is a tool for power users, but most users only want to generate very simple geometry, so this is unfortunate.


    Vector API
    Inspired by HTML Canvas, the new API allow C# programmer to build at a higher level, expressing directly their intention. The API provide easy to use methods for
    • Lines
    • Arcs
    • Beziers
    • Fills
    • Strokes
    • and more!
    This is the same example using the new Vector APIs.
    Code (CSharp):
    1. void OnGenerateVisualContent(MeshGenerationContext mgc)
    2.             {
    3.         var paint2D = mgc.painter2D;
    4.  
    5.         paint2D.fillColor = wireColor;
    6.         paint2D.BeginPath();
    7.         paint2D.MoveTo(p0);
    8.         paint2D.LineTo(p1);
    9.         paint2D.LineTo(p2);
    10.         paint2D.LineTo(p3);
    11.         paint2D.ClosePath();
    12.         paint2D.Fill();
    13.             }
    To build paths, you use the painter2D object in the context and issue commands that moves a kind of virtual pen. So here, we move the pen to the first position, and chain lines together to build a quad.
    Once the path is done, you can either Fill it or Stroke it.

    This remove the need to do many manual tasks as the allocation and the overall management of the data is abstracted, and the process is much more scalable for more complex shapes.

    When doing some visual, doing a quad is the basic, but this API allows doing munch more than that using the different methods (LineTo, Arc, ArcTo, BezierCurveTo) and their arguments.

    Another Example Setting the Color, Caps and Joins
    Setting the color, the way segments are connected, the width of the line is easy with a one liner addition to an existing path. You can use the following options for the connections : upload_2021-12-10_13-57-30.png

    Code (CSharp):
    1.  painter.strokeColor = Color.white;
    2.         painter.lineJoin = LineJoin.Round;
    3.         painter.lineCap = LineCap.Round;
    4.         painter.lineWidth = 10.0f;
    5.         painter.BeginPath();
    6.         painter.MoveTo(new Vector2(100, 100));
    7.        painter.LineTo(new Vector2(120, 120));
    8.        painter.LineTo(new Vector2(140, 100));
    9.        painter.LineTo(new Vector2(160, 120));
    10.        painter.LineTo(new Vector2(180, 100));
    11.        painter.LineTo(new Vector2(200, 120));
    12.        painter.LineTo(new Vector2(220, 100));
    13.         painter.Stroke();
    upload_2021-12-10_13-52-32.png

    With these tool combined, complex path can be achieved:

    upload_2021-12-10_14-2-2.png
    upload_2021-12-10_14-2-15.png


    Fill the shapes:
    The path previously defined can also be filled.

    Code (CSharp):
    1. paint2D.fillColor = Color.Blue;
    2. paint2D.BeginPath();
    3. paint2D.Arc(new Vector2(100,100) 50.0f, 0.0f, 360.0f);
    4. paint2D.Fill();
    upload_2021-12-10_14-7-23.png


    Holes:
    Holes can be created by using the an argument with
    paint2D.Fill

    We support two fill rules: odd-even and non-zero.
    • When using odd-even, new inner segments will toggle if the shape is filled or not.
    • When using non-zero, the fill is toggled when crossing a shape with a different winding order.
    You can read about those fill rules on the web, this is well documented.




    Technical:
    The systems generate all the geometry, but it also allows the rendering to use arcs with an infinite precision without having an infinitely complex geometry.


    Here is a zoom on the result. We can see some color compression artifact when the gif was generated, but no vertices.



    The anti-aliasing used on these curves is the same as what UI toolkit uses for the rounded corners of the visual elements.


    Not implemented:
    We don't have any option for line patterns, gradients, texturing yet.
    The anti-aliasing does not work on self intersecting path.

    Final Words
    We hope this will enable new uses cases for some projects, and we aim at collecting even more feedback to improve the tool in the future. Lets us know your thought and questions!
     
    Last edited: Sep 26, 2022
    McDev02, saskenergy, Neohun and 52 others like this.
  2. adamgolden

    adamgolden

    Joined:
    Jun 17, 2019
    Posts:
    1,555
    I was planning to learn UI Toolkit early next year.. great timing, definite value added, this looks amazing and is a welcome addition for many, I'm sure :)
     
    Aldeminor and Lars-Steenhoff like this.
  3. KamilCSPS

    KamilCSPS

    Joined:
    May 21, 2020
    Posts:
    448
    Simply Bravo.

    Any plans to create a 'drawing' tool in the UI Builder too?
     
  4. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    If your geometry is static, I would recommend an external SVG editor where you would be more comfortable to edit the shapes. You can then import the same in unity with the SVG importer package and assign the result in the UI Builder. The svg importer does not yet support the "infinite resolution curves" but let's hope that it won't take much time now that we have the backend in place ;)

    This programming API is more interesting if you need dynamic elements in c#. These elements could then be use in the builder like any other elements. One example is the connectors in the VFX/Shader graph that are generated dynamically depending on the position of the elements.
    upload_2021-12-10_16-4-38.png
     
    Aldeminor, Orimay, Prodigga and 2 others like this.
  5. TomTheMan59

    TomTheMan59

    Joined:
    Mar 8, 2021
    Posts:
    356
    This seems like exactly what I need for this post I made! (The video at the end of my last post is the best example) https://forum.unity.com/threads/inverse-mask.1208326/

    Does it work like how I would expect where you can cutout that shape and then scale it up or down?

    Would it work as such:
    1. Create the hole with the shape I want.
    2. Scale that hole up or down, allowing you to see any gameplay elements behind that hole.
    Or would you need to generate the hole at a different scale every frame?
     
  6. MousePods

    MousePods

    Joined:
    Jul 19, 2012
    Posts:
    811
    Hi. This tool is really useful! I was wondering if anytime soon it will introduce the path2D tool? Say I need to draw a complex shape such as a mushroom. Using HTML Canvas, I can use SVG data. However, it doesn't seem like this tool can do that.

    Is there any plans to introduce this soon?

    Path2D objects

    EDIT: Or is there a way to do this and I am missing something?

    Thanks!
     
  7. Ashfid

    Ashfid

    Joined:
    Jun 8, 2019
    Posts:
    20
    You guys are making this awesome and more fun to use for us! Always love more frontend webdev inspired features.

    The only issue: It’s in 2022.1 beta and will never backport to 2021.2 right? I don’t know if I can rely on 2022.1 for main project and I absolutely enjoy using UI Toolkit.
     
    CyRaid likes this.
  8. Kirsche

    Kirsche

    Joined:
    Apr 14, 2015
    Posts:
    121
    Thank you so much! This is a great API to work with.

    Any idea what could cause the behaviour below? I'm drawing a simple bezier curve but depending on the angle it seems to break sometimes:



    Source code:

     
    Timboc likes this.
  9. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    The shape-with-hole has to happen within the same path (that is, you define the shape and the hole between BeginPath() and Fill()). So, you would have to regenerate the hole shape at every frame.
     
    mariandev likes this.
  10. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    No idea, but certainly looks like a bug. We'll get that fixed pronto.
     
  11. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    There's no way to draw an SVG shape at this time, but we will work on the SVG importer to make it compatible with the Vector API. I can't provide an ETA at this time, however.
     
    mariandev and MousePods like this.
  12. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Correct, this is 2022.1+. This won't be backported.
     
    mariandev and Ashfid like this.
  13. yasirkula

    yasirkula

    Joined:
    Aug 1, 2011
    Posts:
    2,879
    Although I haven't tried UI Toolkit yet, this looks awesome! How performant is this API?
     
  14. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Performance is good for generating simple geometry as far I as I could test. You should not see any overhead compared to building a mesh "by hand". It is probably not ready to support a custom particle system with thousands of elements updated at every frame on mobile, but I don't think it would be doable with any generic framework (you may need a more manual approach or this) If you have any use case that you think would push the limit, don't hesitate to share with us!
     
    mariandev and yasirkula like this.
  15. vx4

    vx4

    Joined:
    Dec 11, 2012
    Posts:
    181
  16. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,792
    This would be a lot more useful if it could be used without the context of UIToolkit and we could just place the lines etc in the world, more like the Shapes asset.
     
  17. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    This API is meant to create geometry that leverage the rendering features of UI toolkit, such as anti-aliasing, arc rendering and vertex data. Because of this, the implementation is closely tied to the rendering implementation, so they are developed together. The Vector Graphics Package will use that API to make even better scalable graphics when importing for UI toolkit if everything goes according to plan :)

    You are probably looking for the new (and experimental) Spline Package. As the UI toolkit Vector API is meant to create the vertex data that the shader used by UI Toolkit requires, it is close to useless in a 3D environment as there is no depth information, no occlusion against opaque geometry etc. possible with that shader... Shapes is a great library, better suited for some usages as it is lighter, but it could not scale to the complexity of the UI that we are targeting.
     
    KamilCSPS, MousePods, vx4 and 2 others like this.
  18. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    Does it work in runtime or is it only for editor windows?
     
  19. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    It works with both :)
     
    mariandev, vx4 and sewy like this.
  20. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Hello,

    What would be considered an acceptable performance for this API? In my test I'm generating mesh for 1000 visual elements 10 times per second and I'm getting very low performance:

    upload_2022-2-18_12-21-36.png

    Am I doing something wrong, or API is not supposed to be used so often?

    upload_2022-2-18_12-23-43.png

    Additional question: is there a way to just "add" paths to already existing mesh?
     
  21. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    A performance fix is coming soon for 2022.1 which may give a 10x-20x performance boost, depending what you are drawing.

    That said, if you can share your code that generates these drawings we could investigate to see if this isn't hiding some other problem.

    In 2022.2 you will be able to instantiate a new Painter2D any where an start accumulating vector primitives in it. This is not yet landed in the 2022.2 branch, but it is coming soon. This can't be done in 2022.1 unfortunately.
     
    Nexer8 and mariandev like this.
  22. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Thanks, here is the code I use for testing:
    Code (CSharp):
    1. using System.Collections.Generic;
    2. using UnityEngine;
    3. using UnityEngine.UIElements;
    4.  
    5. public class Test : MonoBehaviour
    6. {
    7.     private float _radius;
    8.     private float _angle;
    9.     private List<TestLineVE> _lines = new List<TestLineVE>();
    10.  
    11.     private void Start()
    12.     {
    13.         UIDocument doc = GetComponent<UIDocument>();
    14.  
    15.         for (int i = 0; i < 1000; i++)
    16.         {
    17.             var line = new TestLineVE(UnityEngine.Random.Range(100, 1000), UnityEngine.Random.Range(100, 1000));
    18.             _lines.Add(line);
    19.             doc.rootVisualElement.Add(line);
    20.         }
    21.  
    22.         InvokeRepeating("DrawLine", 1, 0.1f);
    23.     }
    24.  
    25.     private void DrawLine()
    26.     {
    27.         _radius += 10;
    28.         var point = new Vector2(_radius * Mathf.Cos(_angle * Mathf.Deg2Rad), _radius * Mathf.Sin(_angle * Mathf.Deg2Rad));
    29.         _angle += 10;
    30.         _angle = Mathf.Repeat(_angle, 360);
    31.  
    32.         foreach (var item in _lines)
    33.         {
    34.             item.AddPoint(point);
    35.         }
    36.     }
    37. }
    38.  
    39. public class TestLineVE : VisualElement
    40. {
    41.     private List<Vector2> _points = new List<Vector2>();
    42.  
    43.     public TestLineVE()
    44.     {
    45.         generateVisualContent += OnGenerateVisualContent;
    46.         style.position = Position.Absolute;
    47.     }
    48.  
    49.     public TestLineVE(int x, int y) : this()
    50.     {
    51.         style.top = x;
    52.         style.left = y;
    53.     }
    54.  
    55.     private void OnGenerateVisualContent(MeshGenerationContext mgc)
    56.     {
    57.         var paint2D = mgc.painter2D;
    58.  
    59.         paint2D.strokeColor = Color.green;
    60.         paint2D.BeginPath();
    61.  
    62.         for (int i = 0; i < _points.Count; i++)
    63.         {
    64.             paint2D.LineTo(_points[i]);
    65.         }
    66.  
    67.         paint2D.lineWidth = 10;
    68.         paint2D.Stroke();
    69.     }
    70.  
    71.     public void AddPoint(Vector2 point)
    72.     {
    73.         _points.Add(point);
    74.         MarkDirtyRepaint();
    75.     }
    76. }
     
    mcoted3d likes this.
  23. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Looking deeper into this, this particular use-case is problematic. We unfortunately cannot append new sub-paths to another path that is already rendered with Stroke(). So the alternative is what you are doing: rebuild the whole path from scratch.

    This works for simple geometries, but for shapes that may grow indefinitely, the cost of generating an increasingly complex strokes will get slower overtime, and consume more and more memory. (Your examples grows to a few MBs of vertex data after a few seconds).

    We will look to see if we can find a way to keep the path data alive to allow for more efficient appends, but in the meantime it would be preferable to avoid this situation.

    I can think of valid use-cases where this situation may arise (a painting program, for example), but these would probably benefit from being baked into a texture instead of being regenerated from scratch. We have plans to provide code samples that does just that.
     
    mariandev and SimonDufour like this.
  24. Maverick

    Maverick

    Joined:
    Dec 18, 2009
    Posts:
    240
    Thank you for reply,

    My use case is actually drawing graph (chart) lines, that are updated relatively often, thus this stress test.

    As a side note, I've noticed that if I do MoveTo before LineTo for each append (for my case it's acceptable), I get a better performance. I guess it's related to segments connection and MoveTo just skips it (am I wrong?).
     
  25. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    We'll have a look at ways to improve the performance for this use case. As it is right now, paths cannot be modified once Stroke()/Fill() are called, meaning that we cannot go back a modify already existing geometry.

    This is exactly it. With a MoveTo() before each segments, there is no need for joins between sub-paths. This will be particularly efficient with a "Butt" line ending.

    Thanks again for sharing.
     
    Maverick likes this.
  26. bugbeeb

    bugbeeb

    Joined:
    Oct 19, 2021
    Posts:
    22
    This api is such an important addition to ui toolkit. It works so well, your team did an amazing job. Hopefully one day there will be full svg support with element querying and styling. I do however have a few nit-picky suggestions and issues:
    1. Chain the path building method calls like `painter.MoveTo().LineTo().Stroke()`.
    2. Have an overload for `LineTo` that uses relative coordinates to the current vertex location. That way you don't need to calculate where the next vertex should be.
    3. I noticed the arc draws funny when applying the counter-clockwise option
    4. There doesn't seem to be full color support? `new Color(255, 1, 0)` is solid yellow for instance. (This issue is very problematic)
     
  27. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Thanks for your suggestion, we will definitely consider them.


    I think the color must be set before the
    BeginPath
    as we cannnot change the color along the path:

    ex

    Code (CSharp):
    1.         var painter = ctx.painter2D;
    2.         painter.strokeColor = Color.white;
    3.         painter.lineWidth = propertyTools.lineWidth;
    4.         painter.lineCap = propertyTools.lineCap;      
    5.         painter.lineWidth = 2.0f;
    6.  
    7.         painter.BeginPath();
    8.         painter.MoveTo(vertices[0] + offset);
    9.         foreach (var v in vertices)
    10.             painter.LineTo(v + offset);
    11.         painter.LineTo(vertices[0] + offset);
    12.         painter.Stroke();
     
  28. mariandev

    mariandev

    Joined:
    Mar 30, 2013
    Posts:
    23
    The range of the parameters of Color is 0 to 1. You can use Color32 if you want to use the range 0 to 255

    https://docs.unity3d.com/ScriptReference/Color.html
    https://docs.unity3d.com/ScriptReference/Color32.html
     
    JoNax97 likes this.
  29. R4vakk

    R4vakk

    Joined:
    Oct 10, 2015
    Posts:
    17
    Is there a way to use that generated geometry as a mask to hide children overflow?
     
    ron_unity606 likes this.
  30. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Not yet, we are definitely looking into enabling that but for now the built-in borders+backgrounds+masking is active on all elements.
     
  31. bugbeeb

    bugbeeb

    Joined:
    Oct 19, 2021
    Posts:
    22
    mariandev likes this.
  32. mcoted3d

    mcoted3d

    Unity Technologies

    Joined:
    Feb 3, 2016
    Posts:
    1,003
    Would it be possible to share more details about this? I'd like to know if there's a bug in that use-case.
     
  33. bugbeeb

    bugbeeb

    Joined:
    Oct 19, 2021
    Posts:
    22
    I will try to repro this issue again, I only saw it without running the game and sometimes the layout is a little wonky when the uxml updates and I've found running the game resets the doc flow, so maybe it's a red herring.
     
    mcoted3d likes this.
  34. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,618
    Can I draw a line that has a gradient from one end to the other? Think of a healthbar with a gradient where the line is red at 0% and green at 100%. "Line" would not necessarily just two points, but could be a half-circle too for example.
     
  35. bugbeeb

    bugbeeb

    Joined:
    Oct 19, 2021
    Posts:
    22
    The initial post said gradients are not yet supported, but it sounds like this feature is in their backlog.
     
    Peter77 likes this.
  36. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Yes we are because we intend on using the Vector API to render the imported SVG on the long term and that the SVG do support gradient. We are still under planning/consideration for this, so there is no ETA yet available.

    Unlike SVG and HTML`s canvas, the team was tempted to add a "gradient along path" for the stroke option instead of just being able to do uniform gradient. The handling of the corner cases is probably manageable, but that feature may well be impossible with the current tessellation algorithm we developed. Would that divergence with the standard be something useful? (the current alternative that we need to implement for SVG support anyway is to do multiples small segment with their own gradient/color, which would require more vertices)
     
    Arlorean, Nexer8 and mariandev like this.
  37. SpectreCular

    SpectreCular

    Joined:
    Jan 15, 2015
    Posts:
    44
    I love this API and was wondering if there has been any progress toward being able to texture your vector graphics yet, or if there is some sort of workaround to do this currently?
     
  38. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    We are aiming to provide the SVG features on the long term, (look for the svg support item in the roadmap) and that include texturing. No ETA available for now. I think it will be broken down in smaller features and gradients will probably be prioritized before texturing.
     
  39. silveryw

    silveryw

    Joined:
    Sep 21, 2014
    Posts:
    12
    Very helpful, I'm working on a musical rhythm game and need to dynamically draw thousands of rectangles.
    Does it perform better than mesh?
     
  40. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    There is a lot of performance improvements in 2022.2 compared to 2022.1, most of them are 10x.

    The vector API essentially generates the geometry for the UI Toolkit mesh API, so unless you are doing really simple mesh, the performance should be better with the vector API because we already optimized the work.

    I have no comparison with the regular/3d mesh object
     
    mariandev likes this.
  41. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Hi @SimonDufour
    Sorry if its already been done, but is there plans for providing basic shapes (circle, polygon, rectangle with round corners etc etc) in UI Builder for designers to place those shapes visually?
     
    Midiphony-panda and MousePods like this.
  42. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    There is no plan to do so right now, you can possibly suggest your idea to the https://portal.productboard.com/xvo8kmgtx7tkv7desh8cyaj7/tabs/49-ui-design for consideration by the product team.

    That being said, I don't think it will be prioritized because we already have means to achieve that currently.
    • You can use an SVG editor to create the shape wanted, and then use the shape in UI toolkit
    • You can programmatically create your geometry using the vector API
    External SVG editor will provide a much better workflow for creating most shapes compared to the build that concentrate on organizing the hierarchy.

    For circle, you could set the rounded corners on a square visual element to 50% and it will appear as a circle.
     
    jGate99 likes this.
  43. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    this is EVEN better, but i couldnt find anything related to UI Toolkit and SVG, (there is SVG package in preview seperately), So can you please point me to documentation
    https://docs.unity3d.com/Manual/UIE-Controls-Reference.html
     
  44. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    To use a SVG image as a background for a visual element or in the Image component (from c# only), you must install the package. To do so, in the Package Manager window, install the package com.unity.vectorgraphics from git URL.

    With the package installed, I think the importer option were self-explanatory, and you should be good to go. The package does not currently use the Vector API from UITK, so there is no AA on the generated geometry, but we want to make this happen on the long term.
     
    jGate99 likes this.
  45. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    AA is antialiasing i guess, this is the reason i didnt use it this package in ugui because edges were jagged
    however ill wait until it start using Vector API behind the scene, any rough idea when it'd happen? like next 6 months or 12?
     
  46. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    It would be 2023.1 at minimum.
     
    jGate99 likes this.
  47. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Thanks for response Simon, I can now plan better,

    So one last question, if i for example use current SVG preview, and use it to place SVG image in UI Toolkit, and once Vector Apis based SVG becomes available, how much rework it'd require on user side? as simple as just selecting all svg images and Apply settings (like we do in texture setting) , any rough idea of change of worklfow?
     
  48. SimonDufour

    SimonDufour

    Unity Technologies

    Joined:
    Jun 30, 2020
    Posts:
    575
    Yes, I think that should be as simple as changing a dropdown or a checkbox and applying the setting.
     
    jGate99 likes this.
  49. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    awesome
     
  50. SavedByZero

    SavedByZero

    Joined:
    May 23, 2013
    Posts:
    124
    Is there a reason why calling mesh.clear() does not clear the bezier curves I draw each frame, when I call my "Begin()" method? Here's an in progress library a couple of us are working on to mimic Flash's graphics api:
    https://github.com/poke1024/unity-vg-demo/blob/master/Assets/Graphics.cs
    https://github.com/poke1024/unity-vg-demo/blob/master/Assets/Demo2D.cs

    It's working decently well, except for it not clearing the previous draws when I call Begin(), and really murdering the processor when called each frame (though that last part isn't surprising). I was hoping to use this to draw a fluid, dynamically shape shifting cell body, but that's seeming less likely...