Search Unity

  1. Get all the Unite Berlin 2018 news on the blog.
    Dismiss Notice
  2. Unity 2018.2 has arrived! Read about it here.
    Dismiss Notice
  3. We're looking for your feedback on the platforms you use and how you use them. Let us know!
    Dismiss Notice
  4. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  5. Improve your Unity skills with a certified instructor in a private, interactive classroom. Learn more.
    Dismiss Notice
  6. ARCore is out of developer preview! Read about it here.
    Dismiss Notice
  7. Magic Leap’s Lumin SDK Technical Preview for Unity lets you get started creating content for Magic Leap One™. Find more information on our blog!
    Dismiss Notice
  8. Want to see the most recent patch releases? Take a peek at the patch release page.
    Dismiss Notice

SVG Importer | Vector Graphics | Unity UI Supported [RELEASED]

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

  1. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    Awesome, glad to hear! I personally am not aware of any distribution channels... but let me know when you have something up and running and I'll test it!
     
  2. pl_ayground

    pl_ayground

    Joined:
    Dec 17, 2015
    Posts:
    56
  3. royvaneijndhoven

    royvaneijndhoven

    Joined:
    Jun 1, 2017
    Posts:
    36
    Killian, I see that you're importing them while having UWP selected in the Build Settings. This causes problems in the SmallXMLParser class that SVG Importer uses because it can't use some Unicode methods or something. You can comment out that part of the code but you'll lose the functionality to create SVG Assets during runtime so we have had to write our own code to work around that.

    TLDR;
    You'll be able to import the files if you temporarely switch to the Standalone Windows platform or rewrite some part of the SmallXMLParser class.
     
  4. JaimeAL

    JaimeAL

    Joined:
    Dec 4, 2015
    Posts:
    21
    If you need beta testing of a new SVG Importer version feel free to send it and I will implement it into my project see if it breaks or not. Any new and improved versions are always welcome ^^
     
  5. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    24
    As far as I know, if you upload a new version on the asset store, unity will detect the files that are changed when trying to reimport the asset in the project (those will be the only one selected in the drop down menu) :)
     
  6. killianChicoisne

    killianChicoisne

    Joined:
    Jul 5, 2017
    Posts:
    2

    Hi, Thanks for your reply.
    You are right on this, if I import my svg files with other build settings, this work perfectly.
     
  7. Gingerbeer

    Gingerbeer

    Joined:
    Aug 10, 2015
    Posts:
    4
    Thank you very much. It works!!
     
  8. coshea

    coshea

    Joined:
    Dec 20, 2012
    Posts:
    236
    No, I would maintain a separate email list, ask people that want to be on the beta to email you with their Asset Store order number (so you know they have it) and send out the beta that way.

    I'd happily test and feedback too.
     
    shaneparsons likes this.
  9. crdmrn

    crdmrn

    Joined:
    Dec 24, 2013
    Posts:
    24
    Also, @Jaroslav-Stehlik, when using SVGImages on a ScreenSpace-Overlay Canvas, the UIAntialiased shader has no effect, when switching to ScreenSpace-Camera and assigning a Camera to the Canvas then it works.
    My guess is that, as a ScreenSpace-Overlay Canvas is way bigger than a ScreenSpace-Camera one, the antialiasing is just not visible and results in sharper edges. any idea on how to fix this?
     
    shaneparsons likes this.
  10. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    Yeah, this is part of the problem I've been having as well. I'm hoping Jaroslav's new shaders fix it.
     
  11. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    55
  12. mmvlad

    mmvlad

    Joined:
    Dec 31, 2014
    Posts:
    55
    @Jaroslav-Stehlik in SvgImage OnPrepareForRendering is never called.
    Please some help
     
  13. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    @Jaroslav-Stehlik I desperately need the anti-aliasing to work. I needed it when I started this project over 2 years ago, and I need it now more than ever that we're about to make some big distribution deals. I've been patient for a very long time now... Please give me something to work with... anything at all.
     
    royvaneijndhoven likes this.
  14. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    Update: In the meantime, I was able to switch from Screen Space - Overlay to Screen Space - Camera all across the game without causing too many issues, which made everything look slightly better. Additionally I've disabled SVG Importer's anti-aliasing on all SVG Images, and cranked up Unity's to 8x, which also helped quite a bit.

    It's not the perfect solution, because not everybody can use Screen Space - Camera, but in my case it helped quite a bit.
     
    tosiabunio likes this.
  15. raydekk

    raydekk

    Joined:
    Mar 14, 2013
    Posts:
    64
    I'd like to test the new beta version as well. I've bought SVG Importer a long time ago and it's a top tier tool.
    Got a published app using SVG Importer with Unity 5.6.x on both iOS and Android and looking to try the beta with the latest Unity LTS version (2017.4)

    Also had an issue open @ the issue tracker for ages now related to gradient rendering on certain devices like a Galaxy S6, workaround being only forcing openGL ES2 on all devices (https://issuetracker.unity3d.com/is...-incorrectly-on-android-devices-with-mali-gpu). Hope a SVG Importer update will fix it, since Unity set the issue status to "Won't fix".

    I will PM you with my email address, thanks for your work on this wonderful asset.
     
  16. HollyManolly

    HollyManolly

    Joined:
    May 14, 2014
    Posts:
    6
    Hello guys, we recently bought this tool and got stuck on these weird issues.
    Some of the assets dont get imported properly. Here's an example of this. The first one is how it's designed, the second is after Unity's import.
    good.png bad.png
    I went through this thread and found a similar issue but haven't managed to find a solution.

     
  17. shaneparsons

    shaneparsons

    Joined:
    May 5, 2015
    Posts:
    40
    In the example you provided, I'd image that expanding the strokes to objects (mountain) in your design program will probably fix the issue. What program are you using?
     
  18. Aduviel

    Aduviel

    Joined:
    Feb 18, 2016
    Posts:
    3
    Hi all,

    We've just imported the latest version of SVGImporter (1.1.6) on a machine with an older unity install. What exactly does "ignore SVG Canvas" do? We would like the canvas size (and any whitespace) to be respected as we are doing animations using the SVG Frame Animator. When we un-check "Ignore SVG Canvas", the SVG/mesh is not rendered. Is anyone able to help? do we need to copy/paste any hotfixes into the SVGimporter source code or do we just need to update Unity? Our unity version is: 2017.3.1f1.
     
  19. RacistWhale

    RacistWhale

    Joined:
    Jan 25, 2018
    Posts:
    1
    I am using the most recent version of unity.
    Why can i not use .svg assets in my tilemap?

    https://docs.unity3d.com/Manual/Tilemap-TileAsset.html
    Says that "Typically, Tiles are actually Sprites that are arranged on a Tilemap."
    And
    https://assetstore.unity.com/packages/tools/sprite-management/svg-importer-38258
    Says that "SVG importer fully mimics Unity native sprites so your team doesn't have to learn anything new."

    So the tilemap should work with svg assets considering that they are sprites but if I drag the svg asset into the tile pallet nothing happens. So i'm not sure where i can go from here, please help.
     
    Last edited: May 26, 2018
  20. Tapitone74

    Tapitone74

    Joined:
    Sep 20, 2014
    Posts:
    3
    When I use Modifiers ( twirl,sphere..) if the material is Sprite Diffuse , the Image becomes very dark, can't recieve lights. There is a way to solve this problem?
     
  21. royvaneijndhoven

    royvaneijndhoven

    Joined:
    Jun 1, 2017
    Posts:
    36
    @Jaroslav-Stehlik

    Will we get an update that improves Anti-Aliasing in the near future? We're running into a couple of problems that have been posted in this thread multiple times already and the once in a month replies don't really assure that those will be taken care of. A colleagae has tried to contact you through mail but has not received a response.

    Some of the weird behaviour that anti-aliasing causes is described below;
    1. Scaling a SVG Renderer or SVG Image makes it blur way to much, so much that it turns into one big blob.
    2. Increasing the Orthographic Size on a Camera does the same thing but only applies to SVG Images.

    These things create weird side effects in our project. For instance, we fade away objects (SVG Renderer) by slowly scaling objects down and then masking the removal by a particle effect but the anti-aliasing causes flashes because of the asset going wild and spiking when it's nearing a certain scale. A work around that we could use is disabling anti-aliasing when the scale reaches a pre-set point but this will disable anti-aliasing in it's entirety and the player will notice that all the other objects are aliased for a small amount of time.


    The reason we use SVG Importer is because SVG assets would retain their quality no matter how far you zoom in or out. Combine that with the built-in anti-aliasing which is actually better than the Unity anti-aliasing which applies anti-aliasing on everything in the scene. Using other anti-aliasing methods might not be possible for us because we're developing for very specific hardware.
     
  22. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    50
    May be I can help you. First point is what SVG converted to concrete scale, for example 5x, importer creates mesh for 5x quality with some vertex count and triangle count. If you scale greater than 5x, the mesh can't be rendered like in flash or adobe illustrator, because of vertex count. It's not aliasing, it's vertex count. With SVG Importer you can't take universal scaling, like in flash or illustrator. If you need bigger scale than 5x, you should select VertexPerMeter (VPM, QUALITY) in mesh importing process, for example 5000-10000 etc, and this mesh can be scaled to bigger scale, but not to arbitrary.
     
  23. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    50
    In my experience, MSAA is great for SVG Importer. But geometry AA is broken, I can't remember any version with worked geometry AA from SVG Importer. Better use MSAA.
    p.s. Also if you need to disable MSAA partially, you can make two cameras, one with MSAA enabled, and one with disabled, you can progrrammatically change MSAA enabled option on camera, and render specific gameObjects with specific camera by layer index (not 100% sure it work out-of-the-box with importer).
     
  24. oscarlosu

    oscarlosu

    Joined:
    Mar 4, 2015
    Posts:
    8
    Hi @Jaroslav-Stehlik,
    We use Adobe Animate to make svg animations, which are exported frame by frame and rendered in Unity using SVG Importer. This works fine in most cases, but some of our animations need to tween colors. For that, we are using color effects, and those are apparently not working in SVG Importer?

    You can reproduce the problem with the test file attached. If you open it with a browser, yo should see a transparent brown rectangle, but SVG Importer renders it as an opaque brown rectangle, regardless of the import settings.

    Is this feature not supported? Are there any workarounds you know about?
     

    Attached Files:

  25. Ssssilk

    Ssssilk

    Joined:
    Jul 28, 2014
    Posts:
    8
    I, too, am struggling to get the lights to work properly with the imported SVGs.

    Has anyone been able to do so lately?

    I was following these steps, not sure if there's something newer to follow from:


    Thanks.
     
  26. tosiabunio

    tosiabunio

    Joined:
    Jun 29, 2010
    Posts:
    92
    You have to disable anti-aliasing during SVG import and change the shader in your material:



    Although the representation isn't valid as some elements are becoming translucent for some reason. You need to investigate this more.
     
    Last edited: Jun 12, 2018
  27. startleworks

    startleworks

    Joined:
    Jun 8, 2013
    Posts:
    33
    guys check first post
     
  28. syamilsynz

    syamilsynz

    Joined:
    Dec 22, 2013
    Posts:
    29
    Hi @Jaroslav-Stehlik ,

    I got an issue from svg image in unity 2018 after upgrading my project from 2017.

    the ui svg image got weird behaviour, it have weird position and scaling without even edit the value.

    When I set deactive and activate again the gameobject contain ui svg image, it cause a weird problem. Then if I disable the svg image on the inspector, the gameobject is okay. But it just temporary. When I play the editor, the weird behavior occurs again.

    Here is the screenshot of the problem during set active gameobject false into true, and set active svg image false into true.

    How to fix this bug? thank you.
     
  29. silentneedle

    silentneedle

    Joined:
    Mar 14, 2013
    Posts:
    263
    Is there a problem with the anti-aliasing?

    This is how it looks on my end (using Unity 2017 LTS @ MacOS):

    https://imgur.com/a/LIxwVhv

    Strangely it works in the editor window.
     
  30. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    482
    The demo uses really old asset serialization so I think it is only related to the demo.
     
  31. Jindrich-Regal

    Jindrich-Regal

    Joined:
    Nov 22, 2013
    Posts:
    6
    We have exactly the same issue in Unity 2018.