Search Unity

SVG Importer | Vector Graphics | Unity UI Supported [OPEN SOURCE]

Discussion in 'Assets and Asset Store' started by Jaroslav-Stehlik, May 4, 2015.

  1. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    any answers ?
     
  2. pabu

    pabu

    Joined:
    Mar 17, 2010
    Posts:
    30
    Have a look at Plugins/Core/SVGRenderTexture.cs

    Cheers,
    pabu
     
  3. Arganoid

    Arganoid

    Joined:
    Oct 12, 2013
    Posts:
    24
    This file fails to import, with error "SVG Document Exception: An element with the same key already exists in the dictionary."
    https://en.wikipedia.org/wiki/File:Flag_of_Monaco_(state).svg

    (however, implementing clip paths to fix some of the flag files I've posted about previously is a higher priority for me)
     
  4. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Any answer?
     
  5. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Is there any way to patch draw calls ?
    right now svg importer is generating a draw call for every object.
     
    skillbow likes this.
  6. backwheelbates

    backwheelbates

    Joined:
    Jan 14, 2014
    Posts:
    232
    This looks like a great tool!

    Just curious, is it possible to attach 3D colliders to the vector shapes? Id like to use this to prototype 3D sidescrolling levels.

    Thanks!
     
  7. andreidbz

    andreidbz

    Joined:
    Feb 23, 2014
    Posts:
    3
    Hi.
    Can I use SVG Importer to make a Unity WebGL app so that it downloads and show SVG in real time? So I don't want to use it in the editor, but in a real-time enviroment. Can it handle SVGs like this? thanks
     
  8. eigenlaut

    eigenlaut

    Joined:
    Oct 22, 2014
    Posts:
    10
    svg importer converts svg's to geometry during the import, you are not rendering svg's in realtime
     
  9. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Is there any way to patch draw calls ?
    right now svg importer is generating a draw call for every object.
     
  10. infinite360VR

    infinite360VR

    Joined:
    Apr 19, 2016
    Posts:
    23
    Right now SVGImage component does not support filled type. Would this be implemented in any future versions? or is there a way to extend the code to support filled type images.
     
  11. RazaTech

    RazaTech

    Joined:
    Feb 27, 2015
    Posts:
    178
    Hi there i want to make texture thumbnails(1X ,2X ,3X) of svgs is there any way to to do it ..?
     
  12. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Hi there, i'm not responsible for svg importer development but I'm familiar with it.

    What do you mean by 1X, 2X, 3X ?

    one of the main benefits of svg importer is that it is to a large degree resolution independent (will look great on hd & sd screens), so why do you want 3 sizes of the texture ?
     
  13. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    Same error here when doing Unity Cloud Builds. Only way I found to get around it was to delete both the 'StandardSpecularSVG.shader' & the 'StandardSVG.shader' files.

    Is there any official solution yet?
     
  14. RazaTech

    RazaTech

    Joined:
    Feb 27, 2015
    Posts:
    178

    for thumbnails
     
  15. Luke57d

    Luke57d

    Joined:
    Dec 2, 2016
    Posts:
    6
    Hi,

    Apologies if this has been asked before, however, I'm wondering if it's possible to load an SVGAsset at runtime? I'm trying to change the Vector Graphics property to another SVGAsset when a button is pressed but can't find any documentation on how to do it.

    I tried the following:

    Code (CSharp):
    1. svgImage.vectorGraphics = SVGAsset.Load("svg_new_filename", null);
    However, I get the following error:

    Any help would be great, thanks.
     
  16. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    you can duplicate the thumbnail asset 3 times & change the quality settings of each copy to generate different levels of mesh complexity for the same image

    but I don't think you need that, ( on of the main advantages of svg importer is that meshes work well on hd & sd screen sizes)
     
  17. infinite360VR

    infinite360VR

    Joined:
    Apr 19, 2016
    Posts:
    23
    SVG Image component is creating a huge spike in profiles because of OnPopulateMesh() call every time an object is activated. It allocates up to 10MB to GC for bunch of elements. Is there any way to fix this?
     
  18. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
  19. RedGuts_

    RedGuts_

    Joined:
    Oct 23, 2013
    Posts:
    4
    Hi guys,
    I just switch on Unity 5.5 (because of the Linear rendering support on IOS), and i'm working on a IOS project.

    "Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on metal)"

    did any one of you had this one?

    ty
     

    Attached Files:

    TeamZero likes this.
  20. Blue-Candle-Games

    Blue-Candle-Games

    Joined:
    Jun 17, 2015
    Posts:
    4
    Is this tool in a good state right now? The number of issues and few replies makes me wonder if I should avoid purchasing this tool for a while. Thanks.
     
    Ali_V_Quest likes this.
  21. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    I'm having the same issue. It appears to be wider spread than just iOS. I upgraded my project to Unity 5.5.0f3 and received these errors for each platform:

    iOS:

    Code (csharp):
    1.  
    2. 26: [Unity] Shader error in 'StandardSVG': invalid subscript 'posWorld' 'FragmentSetup': no matching 5 parameter function at Assets/SVG Importer/Plugins/Shaders/Standard/UnitySVG.cginc(118) (on glcore)
    3. 27: [Unity] Shader error in 'StandardSVG': 'MainLight': no matching 1 parameter function at Assets/SVG Importer/Plugins/Shaders/Standard/UnitySVG.cginc(119) (on glcore)
    4. 273: [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on gles3)
    5.  

    MacOS:

    Code (csharp):
    1.  
    2. 26: [Unity] Shader error in 'StandardSVG': 'MainLight': no matching 1 parameter function at Assets/SVG Importer/Plugins/Shaders/Standard/UnitySVG.cginc(119) (on glcore)
    3. 270: [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on metal)
    4.  

    Windows:

    Code (csharp):
    1.  
    2. 12229: [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on d3d9)
    3. 12233: [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on d3d11)
    4. 12237: [Unity] Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on d3d11_9x)
    5.  
     
  22. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    Update: I was able to get all my Unity 5.5 builds working again by simply deleting the shaders throwing the errors. This doesn't appear to have broken anything in my project, but anyone else who tries this method should approach it with caution. It's definitely not an ideal solution, but at least I can continue making builds until @Jaroslav-Stehlik releases an update to prevent/fix the issue.
     
  23. numberkruncher

    numberkruncher

    Joined:
    Feb 18, 2012
    Posts:
    953
    Since the latest version of SVG Importer the sprites have had flickering black triangles all over them. Since it's been too much effort I've simply removed SVG Importer from my project and replaced with regular sprites.
     
  24. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Anyone tried the other svg asset (simply svg) from the asset store?
     
  25. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    I am deeply sorry that I was unable to respond to anyone of you.
    I am now undergoing a long-term treatment.
    I am having for three years panic and anxiety attacks which I was not aware of what they are.
    The doctors were looking for heart conditions but not for the head. Last month
    when I collapsed the doctors went for diagnosis that it is caused by mental health.
    So I am on heavy stimulants which make my work much harder.

    If you could please bring up a simple list of most important bugs I should focus on
    so I could at least try to deliver an update.

    Have a nice holidays
     
    skillbow, numberkruncher and TeamZero like this.
  26. TeamZero

    TeamZero

    Joined:
    Sep 3, 2013
    Posts:
    30
    Thank you so much for responding to let us know what is going on. I hope the doctors are able to help and that the treatment allows you to return to more of a normal life. I've dealt with similar issues and know how difficult it can be for outsiders to understand.

    Regarding a list of bugs, I think the biggest concern is the lack of Unity 5.5 compatibility.
    So a good starting point for finding issues & making fixes would be to launch Unity 5.5, create a new project, and import the SVG Importer Asset Package. Upon opening, Unity will immediately notify you that SVG Importer uses old API's, and then asks you to upgrade the scripts.
    Screen Shot 2016-12-13 at 19.21.34.png
    After the scripts are done upgrading, try to make a build and you will see shader errors appear that are preventing Unity from finishing the build creation.
    Screen Shot 2016-12-13 at 19.40.03.png


    I have a bunch of other issues with my project and SVG Importer, but I think those issues are because I had to delete a bunch of SVG Importer's shaders and a .cginc file in order to get my project to build correctly on Unity 5.5.
    Screen Shot 2016-12-13 at 19.42.16.png


    Happy holidays to you as well! Hope you are beginning to feel better!
     
  27. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    Sorry to hear that & hope you recover ;)

    - I've wanted to know :
    1. if we can patch svg importer draw calls
    ( right now every svg importer object uses a draw call)
    2. if we can't patch them, are they light draw calls ( doesn't affect performance much ) or should we take caution when using svg importer for lots of objects.

    wish you the best & take good care of yourself.
     
    skillbow and numberkruncher like this.
  28. kenshin

    kenshin

    Joined:
    Apr 21, 2010
    Posts:
    940
    Hi all,

    I am interested to use your importer to import SVG file at runtime in a webgl build.
    Is this possible?

    Anyone can give me an answer?

    @Jaroslav-Stehlik, all the best for your health! :)

    Thanks in advance!
    Kenshin
     
  29. Max_power1965

    Max_power1965

    Joined:
    Oct 31, 2013
    Posts:
    127
    Hello,
    I've already tried to send you an email 4 days ago but I didn't have got any answer yet. Here is the problem:

    I'm working with the unity 5.4 version, the project it's exported correctly for iOS and Android, but when i'm trying to export it for windows phone, I got these errors:

    Assets\SVG Importer\Plugins\Core\Mesh\SVGMeshUtils.cs(1207,26): error CS1061: 'System.Collections.Generic.List<int>' does not contain a definition for 'ForEach' and no extension method 'ForEach' accepting a first argument of type 'System.Collections.Generic.List<int>' could be found (are you missing a using directive or an assembly reference?)

    Assets\SVG Importer\Plugins\Triangle\IO\FileReader.cs(166,42): error CS1502: The best overloaded method match for 'System.IO.StreamReader.StreamReader(System.IO.Stream)' has some invalid arguments

    Assets\SVG Importer\Plugins\Triangle\IO\FileReader.cs(277,42): error CS1502: The best overloaded method match for 'System.IO.StreamReader.StreamReader(System.IO.Stream)' has some invalid arguments

    and another 10 like this when is time to export for windows phone.

    I'm I missing something?? with the other platforms works without problems.

    On the mail that I've sent I've attached my invoice.

    Let me know as soon as possible.

    Thank you for your time.

    Marco.
     
  30. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    280
    Make SVG importer more non destructive. It's bad practice to add components automatically (like SVG Camera on all camera GO's). Also make it possible to disable SVGAtlas.Update(), which also runs if the scene doesn't contain any svg components.
     
  31. UmairEm

    UmairEm

    Joined:
    Nov 7, 2015
    Posts:
    31

    Extremely sorry to hear this!
    I hope you get better soon :)
     
  32. himalaio

    himalaio

    Joined:
    Nov 18, 2016
    Posts:
    1
    Hello! I used SVG Importer and it worked perfectly, but at some point on iOS I got the following error and cannot build anymore (still works well for Android):

    Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on metal)

    Any ideas how to fix this?
     
  33. cyruschoi

    cyruschoi

    Joined:
    Sep 13, 2016
    Posts:
    3
    I would like to create an application to display magazine content under unity ( mostly with text of different fonts and layout ) . Understand that SVG importer can display text using outline .

    It would be very nice if any one here can share
    1. How is the speed ? for like display a SVG file of 1 MB ? ( for PC, and mobile devices as well )
    2. How much memory is needed ?
     
  34. Ali_V_Quest

    Ali_V_Quest

    Joined:
    Aug 2, 2015
    Posts:
    138
    have you tried the outline component (built in with unity) ?
     
  35. xqtr123

    xqtr123

    Joined:
    Jun 7, 2014
    Posts:
    20
    Hi!
    When I try to import a SVG from a vector that is only in black color the background gets all white! How come?

    Setup without black stickman:
    org.png

    Setup with black stickman:
    white.png

    Stickman config:
    test.png
     
  36. rarebyte

    rarebyte

    Joined:
    Sep 26, 2015
    Posts:
    11
    First off: Best wishes on getting better!

    If anything I'd also vote for getting the asset to not mark builds as failures in unity 5.5 (I'm getting the same error with the 'compresed' shader - it's obviously a typo in there). This prevents me from being able to use Unity Cloud Build for all my projects.

    Regards

    Edit: For now I got it working deleting only the file "GradientColorAlphaBlendedAntialiasedCompressed.shader" from one of my projects
     
    Last edited: Dec 19, 2016
    Jaroslav-Stehlik likes this.
  37. jGate99

    jGate99

    Joined:
    Oct 22, 2013
    Posts:
    1,945
    Getting following error and project is unable to compile.
    Shader error in 'SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed': Did not find shader kernel 'vertexGradientsAntialiasedCompresed' to compile (on gles3)
     
  38. xqtr123

    xqtr123

    Joined:
    Jun 7, 2014
    Posts:
    20
    Hi!
    I made an svg from Design215's Screen Resolution Chart (screen_resolutions_svg.zip).
     

    Attached Files:

  39. xqtr123

    xqtr123

    Joined:
    Jun 7, 2014
    Posts:
    20
    Hi!
    I'm trying to put Vectrosity's vector line renderer inside the SVG Sorter, but it doesn't show. Anyone know why? It doesn't work with Unity's line renderer as well.
     
    Last edited: Dec 21, 2016
  40. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    SVG Importer/GradientColor/GradientColorAlphaBlendedAntialiasedCompressed
    fastest fix would be to remove these files because they are not used anymore.
     
  41. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    For text I would highly recommend using superb plugin Text Mesh pro
    as this solution would be much more useful for text rendering and definitely more efficient and sharp.
     
  42. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Please attach me the SVG File. I would love to look at that.
     
  43. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Good solution!
    Would definitelly post an update.
     
  44. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Simply delete that file.
    It should be deleted in upcoming version.
     
  45. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    H
    Hello,
    SVGSorter works purely only with SVGRenderer components.
    that is probably the issue you have.
     
  46. pabu

    pabu

    Joined:
    Mar 17, 2010
    Posts:
    30
    Good to see you back in the forum Jaroslav! I was sad to hear about your illness and hope you find your way back to full recovery soon. Although I would love fixes for any outstanding issues in SVG importer, I would be even happier knowing that you put your own health and recovery first.

    Cheers,
    pabu
     
  47. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    Thank you for your message. I will try my best.
    What bug would you think would have the biggest priority right now?
    Thank you!
     
  48. pabu

    pabu

    Joined:
    Mar 17, 2010
    Posts:
    30
    Just opening the latest distributed version of the package in the latest version of Unity and fixing all console errors and warnings (regardless of severity) and make a new release out of that would be a great start. Low effort and will benefit most users directly.

    Cheers,
    pabu
     
    TeamZero likes this.
  49. jnbt

    jnbt

    Joined:
    Jul 8, 2013
    Posts:
    11
    If I delete this shader I'm not able to import most of my SVGs anymore. The importer crashes to a NullReferenceException.
     
  50. tacoilluminati

    tacoilluminati

    Joined:
    Oct 30, 2015
    Posts:
    6
    I can confirm that removing the GradientColorAlphaBlended shaders causes a null ref on asset import, making the asset unusable.
    SVGRenderer.cs line 802
    Unity 5.5.0f3