Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

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

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

  1. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    So I have today found out a solution to anti-aliasing errors so I would push a new Update until Unity Approves it :)
     
    shaneparsons and TeamZero like this.
  2. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    Are you sure that it is just scene size or the whole build size?
     
  3. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    I am not really sure what this is causing but with new Unity, the geometry antialiasing started doing weird things which is related to the latest version of SVG Importer. do you have enabled antialiasing on your asset?
    If so, I am just working today to publish a hotfix on the asset store.

    If you are having other problems, it could be related to mesh compression as it looks
    not precise enough. Then we would have to investigate that further.

    Thank you for your kind words!
     
  4. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello, I am looking at the stack trace but I am unable to find the problem, the line which the error is pointing at is rubbish.
     
  5. onceabird

    onceabird

    Joined:
    Feb 24, 2017
    Posts:
    1
    I'm using SVG Importer and the antialising problem seems to remain, with or without lighting enabled...
     
  6. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    That is because Unity did not approve the update I just submitted :)
    Wait a little bit, thank you.
     
  7. Goodyearpimp

    Goodyearpimp

    Joined:
    Jun 5, 2014
    Posts:
    3
    I appreciate the re-surgence of support, this is a great tool!

    I have tried creating several mesh deformers from scratch as well as purchasing JellyMesh & JellySprite. None of these tools seem able to deform the SVG Renderer meshes.

    I absolutely want to use SVGs, but for my project it is a must that I can deform them (due to collisions, etc).

    Please please help me anyone :) Have hit a brick wall for months!!!!
     
  8. JaimeAL

    JaimeAL

    Joined:
    Dec 4, 2015
    Posts:
    21
    Just tried the new version and in some SVG Renderers I get the following console errors:

    NullReferenceException: Object reference not set to an instance of an object
    SVGImporter.SVGRenderer.get_sortingOrder () (at Assets/SVGimporter/Plugins/Core/SVGRenderer.cs:248)

    NullReferenceException: Object reference not set to an instance of an object
    SVGImporter.SVGRenderer.set_vectorGraphics (SVGImporter.SVGAsset value) (at Assets/SVGimporter/Plugins/Core/SVGRenderer.cs:92)

    They happen in lines of code where I try to set one of those values on enable, sometimes at the very beginning of a scene. Most SVG renderers work but the ones that do not break the rest of the game.

    EDIT: This is a small note, but there is a debug.log on the Awake and Destroy of the SVGRenderers, not a big deal as I can just comment it out, but figure I'd mention it
     
    Last edited: Jul 24, 2017
    Jaroslav-Stehlik likes this.
  9. moonmenlabs

    moonmenlabs

    Joined:
    Mar 27, 2017
    Posts:
    3
    Thanks a bunch
     
  10. mikolajewskip

    mikolajewskip

    Joined:
    Mar 29, 2017
    Posts:
    16
    Same here after update:

    This happens when I am trying to change sorting order of object programmaticaly. Any tips?

    Issue 2:

    When I import svg and apply antialiasing - it is ok.
    But if i mirror it by rotation (rotate X -1.0f) then antialiasing is lost
     
    Last edited: Jul 26, 2017
    Jaroslav-Stehlik likes this.
  11. Fernandxor

    Fernandxor

    Joined:
    Oct 13, 2014
    Posts:
    23
    Purchased SVG Importer yesterday, after reading good critics about this asset.
    Despite some warning messages related to obsolete method calls, it's a nice work overall. But, does SVG Image (UGUI) have Antialising? In the scene window it shows ok, but in game window pixels look like LEGO bricks :(

    BTW: I'm using Unity 2017.1.0f3
     
    Last edited: Jul 26, 2017
  12. chunky_octopus

    chunky_octopus

    Joined:
    Apr 11, 2015
    Posts:
    14
    Hi!
    I am trying to get separated mesh from one SVG file.
    I.e. if I have a group <g id = 'myGroup'> I would like to be able to assign a different material to that group.
    First thing first, how can I access the SVGElements?

    Thanks!
     
  13. Roywise

    Roywise

    Joined:
    Jun 1, 2017
    Posts:
    68
    Check this out: https://issuetracker.unity3d.com/is...in-game-view-with-screen-space-overlay-canvas

    Don't forget to vote for this bug to be fixed. Temporary solution; use ScreenSpace Camera for the Canvas.
     
  14. Fernandxor

    Fernandxor

    Joined:
    Oct 13, 2014
    Posts:
    23
  15. RomkaKing

    RomkaKing

    Joined:
    Nov 20, 2015
    Posts:
    3
  16. WayneC

    WayneC

    Joined:
    Jan 15, 2016
    Posts:
    13
    @Jaroslav-Stehlik Hi , will you contiune to support SVG Importer through unity 2017.x lifecycle? It's important to us. thanks!
     
    Jaroslav-Stehlik likes this.
  17. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    For sure I will!
     
    TeamZero likes this.
  18. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    This kind of rendering is much more efficient to do with the Unity Line Renderer and dashed texture / material.
    If this would be done in SVG Importer, it would need to create geometry every Update which would be highly insufficient.
     
  19. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,
    What kind of deformation do you need?
    Could you give me an specific use case?
    Thank you.
     
  20. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thanks! U just figured out how to sovle the negative scale :)
     
  21. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    DO you have now some 2017 specific errors?
     
  22. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hi Everyone!
    U just made a Tutorial Video on how Antialiasing in SVG Importer works!
     
    shaneparsons, TeamZero and Inspeinre like this.
  23. JaimeAL

    JaimeAL

    Joined:
    Dec 4, 2015
    Posts:
    21
    EDIT: I just noticed the Antialising Width setting is not working, not changing the blur at all, disabling and enabling antialising seems to not do a thing too?


    Just got the new update! This still happens:

    NullReferenceException: Object reference not set to an instance of an object
    SVGImporter.SVGRenderer.get_sortingOrder () (at Assets/SVGimporter/Plugins/Core/SVGRenderer.cs:248)

    NullReferenceException: Object reference not set to an instance of an object
    SVGImporter.SVGRenderer.set_vectorGraphics (SVGImporter.SVGAsset value) (at Assets/SVGimporter/Plugins/Core/SVGRenderer.cs:92)

    But I figured out how to fix them, even though is going back a bit to the previous version

    In SVGRenderer.cs, this is what breaks:
    Code (CSharp):
    1.         protected MeshRenderer _meshRenderer;
    2.         public MeshRenderer meshRenderer
    3.         {
    4.             get
    5.             {
    6.                 if (_meshRenderer == null)
    7.                 {
    8.                     _meshRenderer = GetComponent<MeshRenderer>();
    9.                 }
    10.                 return _meshRenderer;
    11.             }
    12.         }
    13.  

    From a previous version, using the following code fixes those two errors:
    Code (CSharp):
    1.         protected MeshRenderer _meshRenderer;
    2.         public MeshRenderer meshRenderer
    3.         {
    4.             get
    5.             {
    6.                 if (_meshRenderer == null)
    7.                 {
    8.                     _meshRenderer = GetComponent<MeshRenderer>();
    9.                     if (_meshRenderer == null)
    10.                     {
    11.                         _meshRenderer = gameObject.AddComponent<MeshRenderer>();
    12.                     }
    13.                 }
    14.                 return _meshRenderer;
    15.             }
    16.         }
    17.  


    However doing so gives yet another error that is solved the same way, error pops up on:

    Code (CSharp):
    1.         protected MeshFilter _meshFilter;
    2.         public MeshFilter meshFilter {
    3.             get
    4.             {
    5.                 if (_meshFilter == null) GetComponent<MeshRenderer>();
    6.                 return _meshFilter;
    7.             }
    8.         }
    9.  

    Changing it to this fixed it
    Code (CSharp):
    1.         protected MeshFilter _meshFilter;
    2.         public MeshFilter meshFilter
    3.         {
    4.             get
    5.             {
    6.                 if (_meshFilter == null)
    7.                 {
    8.                     _meshFilter = GetComponent<MeshFilter>();
    9.                     if (_meshFilter == null)
    10.                     {
    11.                         _meshFilter = gameObject.AddComponent<MeshFilter>();
    12.                     }
    13.                 }
    14.                 return _meshFilter;
    15.             }
    16.         }

    Will keep using the newest version with these couple of changes and see if it breaks anywhere else, but it should not since the previous version I was using had them declared this way, my guess is that I am trying to access components too fast on start before Unity has been able to initializate them.

    Figured I'd mention about it! Hyped to see negative antialising fix!
     
    Last edited: Aug 4, 2017
    Jaroslav-Stehlik likes this.
  24. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Correct! thanks for that!
     
  25. mikolajewskip

    mikolajewskip

    Joined:
    Mar 29, 2017
    Posts:
    16
    Glad to help ;) was there another method?

    anyway - the problem was that when I did have svg imported with scale 1.0f (any positive) all was ok, when x=-1.0f reflection was done but antialiasing was lost

    regards
     
    Jaroslav-Stehlik likes this.
  26. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    The version which was today released handles negative scales
     
  27. mikolajewskip

    mikolajewskip

    Joined:
    Mar 29, 2017
    Posts:
    16
    Thank you!
     
    Jaroslav-Stehlik likes this.
  28. mgreene1

    mgreene1

    Joined:
    Feb 29, 2016
    Posts:
    5
    I am developing on Unity 5.6 and I have hit a wall using the importer. Everytime I export or 'save as' from AI (using the settings in the documentation) the SVGs produced in Unity lose their curves and instead are replaced by straight lines that connect at the anchor points to complete line. In short, all the smooth edges of strokes are removed for some reason. At first, I kept getting black artifacts and a "Transforms are Expanded" error from AI when I tried to Save a Copy. I've been able to get around it by using the 'Export As' command instead, even though it contains less SVG options. But I can't seem to find any resource on why this is happening. Is there some suggestion on what is going wrong?

    Edit: I tinkered around with the 'Quality' setting in the SVG window in unity and it seems to help somewhat, if I turn it up to a crazy number like 30,000. I think what is most concerning me (now that I am better examining what is happening) is that say I am working on my character's head, as I zoom out or increase the size of the camera the details on my character's face don't stay sharp. They start to condense into a black blob, as if the stroke width doesn't scale proportionately. I was under the impression that SVGs keep their clarity no matter how close or far they are zoomed in/out on? Why are my SVGs so sloppy looking?
     
    Last edited: Aug 7, 2017
    Jaroslav-Stehlik likes this.
  29. ADoby

    ADoby

    Joined:
    Dec 10, 2012
    Posts:
    21
    Antialiasing is totally broken.

    UI SVG Image Antialiasing is based on Screenposition. Moving a svgImage closer to the screen center will narrow the antialiasing width.
    Moving it closer to screen edge will strengthen the antialiasing.
     
  30. mgreene1

    mgreene1

    Joined:
    Feb 29, 2016
    Posts:
    5
    I haven't really seen anything vary due to where the screen was positioned. It seems to happen when I either zoom out in the editor or I make the camera bigger (so the SVG seems smaller), in both cases the strokes making up detail begin to become fuzzy black blobs instead of staying sharp.

    Edit: Ok I see what is happening now. I'm not sure if this is what you were talking about, @ADoby, but it seems that the 'anti aliasing' setting for SVG importer in the asset s inspector is to blame. Once I turned it off and used the Unity quality settings my SVGs become sharp again. I'm glad @ADoby mentioned antialiasing either way.
     
    Last edited: Aug 10, 2017
    Jaroslav-Stehlik likes this.
  31. ADoby

    ADoby

    Joined:
    Dec 10, 2012
    Posts:
    21
    @mgreene1 @Jaroslav-Stehlik Here a small scene.
    I added 1 SVG image (a circle) with the same scale 5 times, in the center and on the edge of the screen.
    I also added 1 copy stretching it over the screen.
    You can easily see the changing antialiasting width based on screen position of the vertex.
    This is using Version 1.1.6.

    EDIT:
    I Debugged a little bit and I found out which part of the shader does this:
    Removing: * length(ObjSpaceViewDir(vertex))
    from SVGImporterCG antialiasing fixes the screen based antialiasing.
    YOU have to use bigger numbers for antialiasing width thought like 5000 instead of 5.

    EDIT 2:
    Multiplying the Antialiasing with " _ScreenParams.x" makes it work a bit better with different resolutions and you don't have to use 5000 as width which fixes Editor rendering.
    But this doesn't work with portrait resolutions and editor/game looks different.

     
    Last edited: Aug 11, 2017
  32. Jindrich-Regal

    Jindrich-Regal

    Joined:
    Nov 22, 2013
    Posts:
    6
    Thx for your post, I also had this issue, SVG importet 1.1.6, Unity 2017.1.0f3

    @Jaroslav-Stehlik
    You have wrong version in about window. It shows 1.1.3, not 1.1.6.
     
  33. Roywise

    Roywise

    Joined:
    Jun 1, 2017
    Posts:
    68
    @Jaroslav-Stehlik
    After updating to version 1.1.6 we got a NullReferenceException and we traced it back to the SVGRenderer class. See the image below, left is the current code, right is the alteration we did to fix the problem.

    Notice that the left has implemented a nice null check but then does not caches the GetComponent call into the actual _meshRenderer. Which results in the _meshRenderer variable staying null. Also, the MeshFilter getter does a GetComponent call to get the MeshRenderer, should obviously be MeshFilter.

    SmallOversightInUpdate.png
     
    Last edited: Aug 16, 2017
    Jaroslav-Stehlik likes this.
  34. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    I have to create an explanation video about how SVG Importer handles units.
    The quality of your vector art depends on the units inside the document.
    That is probably the reason why you had to increase the quality so much.
     
  35. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    Thank you for your report.
    Could you please send me a quick screen capture so I can investigate that
    further?
    Thank you for your help!
     
  36. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Hello,

    I had issues that in editor it looks different than in the actual game.
    That is correct, the latest midification was done because when negative scaling
    or rotating the image 180 in Y completelly turned off the antialiasing.
    I gues I have to find another work around.
    Thanks for your report, you rock!
     
  37. Jaroslav-Stehlik

    Jaroslav-Stehlik

    Joined:
    Feb 20, 2012
    Posts:
    485
    Thanks,

    thats really stupid bug!
     
  38. ADoby

    ADoby

    Joined:
    Dec 10, 2012
    Posts:
    21
    You did already reply to the answer which contains the screenshot.


    @mgreene1 @Jaroslav-Stehlik Here a small scene.
    I added 1 SVG image (a circle) with the same scale 5 times, in the center and on the edge of the screen.
    I also added 1 copy stretching it over the screen.
    You can easily see the changing antialiasting width based on screen position of the vertex.
    This is using Version 1.1.6.

    EDIT:
    I Debugged a little bit and I found out which part of the shader does this:
    Removing: * length(ObjSpaceViewDir(vertex))
    from SVGImporterCG antialiasing fixes the screen based antialiasing.
    YOU have to use bigger numbers for antialiasing width thought like 5000 instead of 5.

    EDIT 2:
    Multiplying the Antialiasing with " _ScreenParams.x" makes it work a bit better with different resolutions and you don't have to use 5000 as width which fixes Editor rendering.
    But this doesn't work with portrait resolutions and editor/game looks different.


    Hello,

    I had issues that in editor it looks different than in the actual game.
    That is correct, the latest midification was done because when negative scaling
    or rotating the image 180 in Y completelly turned off the antialiasing.
    I gues I have to find another work around.
    Thanks for your report, you rock!
     
  39. empathlabs

    empathlabs

    Joined:
    Jul 28, 2016
    Posts:
    3
    Hi, I have a strange issue in my scene where SVG UGUI assets are rendering as black (unlit). It seems to be caused by some issue with lighting and the cameras... if I enable a projector light in the scene, the assets will get all their color back (be lit). I've tried to find this in this forum... I've cleared all baked lighting, made sure all the settings between scenes are similar... I'm not sure where to check anymore... Any ideas?
     
  40. empathlabs

    empathlabs

    Joined:
    Jul 28, 2016
    Posts:
    3
    I seem to have solved this issue by making the shader "SVG Importer/SolidColor/SolidColorAlphaBlendedAntiAliased" instead of "SVG Importer/UI/UIAntiAliased".

    If it's relevant... I have to use OpenGLES2.0 as the graphics API on this project because another plugin has a conflict with Metal on iOS... The black SVG problem with "SVG Importer/UI/UIAntiAliased" was only noticed on iPhone 7 and iPhone 7+. iPhone 6 didn't have the issue.
     
  41. empathlabs

    empathlabs

    Joined:
    Jul 28, 2016
    Posts:
    3
    I am not sure if this is related... but now I have an issue where in a 2D scrollview, the SVG assets are shown beyond the extants of the scrollview, and are not being masked. I am using an Image and Mask as part of the scrollview. Unity 2017.1.0f3, SVG Importer 1.1.3. Thanks!
     
  42. V4nKw15h

    V4nKw15h

    Joined:
    Dec 16, 2011
    Posts:
    47
    Hi Jaroslav,

    I've been working with SVG Importer for 18 months on a project that is close to finished. However I ran into a problem on update 1.1.3. I'd be happy to upgrade to the latest version but I'd like to check with you first if my issue is fixed. Updating obviously brings with it some risks, and it's not worth it for me if the problem still exists.

    Let me explain.

    Prior to 1.1.3 I could use the SVG Collider 2D component to alter the quality of the collider. I have planets that are built from SVG's and have up to 35,000 triangles and vertices in their mesh. This was always fine for performance because I could use the quality slider on the SVGCollider2D component to reduce the collider complexity while still matching the high quality mesh shape. However, after updating to 1.1.3 a few months ago I discovered that this no longer worked the same way. The created collider would be an exact match for the mesh at 1.0 quality, but the next step down would create a MASSIVELY reduced quality collider that was totally unusable. The collider would drop in quality removing 90%+ of the collider vertices. It wouldn't even remotely match the mesh any more. I can either have a super high density collider or a super low density one but nothing in between.

    This was not the case prior to 1.1.3. Prior to 1.1.3 I could drop the collider quality down to 0.9 or 0.95 and it would reduce the density of the collider nicely. This used to work similarly to the way the import quality settings tweaked the density of the mesh in nice small steps. It would retain the overall shape of the mesh but at a much lower density.

    Were you aware that this problem existed and did you fix it in the more recent versions?
    Thanks for your time, and I'm happy to see that you are feeling better. SVG Importer is an amazing tool if I could just solve this one last issue I have with it.

    Edit: On getting back to work today, I decided to look into solving this myself. I suspect it's an issue with my very large sized planet colliders(2000 units across). I added a new boolean flag, that I could set on the SVGCollider2D component, that when active would do
    precision *= 0.05
    This was inside SVGCollider2D.UpdateCollider()

    This solved my issue. Now I can fine tune the collider as I used to before. My physics performance went from 50+ms per frame to 5ms once I was able to tweak the points on the PolygonCollider2D down from 6000 to 1000.

    Jaroslav, you may wish to incorporate more range in your quality slider to allow for other users to be able to deal with similar situations with large colliders.
     
    Last edited: Sep 4, 2017
  43. cjsawyer

    cjsawyer

    Joined:
    May 7, 2015
    Posts:
    6
    Hello.

    I have two problems with antialiasing on 2017.1.0p4

    1 - No matter what I do, only one SVG renderer can be on the screen at a time. If there are two, the antialiasing is lost.
    2 - If the Z scale is not set to 0, the sprites get all fuzzy like I had set them to 1000px antialiasing.
     
  44. ADoby

    ADoby

    Joined:
    Dec 10, 2012
    Posts:
    21
    Antialiasing is currently close to broken.
    These fixes are for SVG Importer Version 1.1.6

    1. ALL SVG Assets need to have Antialiasing ON, if you turn it off on just one the SVGImage will disable Normal-Channel in its parent Canvas and break SVG Rendering completely.

    2. Check if Normal Channel is enabled in Canvas "Additional Shader Channels"

    3. Antialiasing will be different based on screen-position, kinda fixed, see posts above
     
  45. Th0re

    Th0re

    Joined:
    Sep 4, 2015
    Posts:
    39
    Hi @Jaroslav

    I have this asset for quite a while now, it's great!

    I encounter a problem which I could not resolve yet: I want the SVG sprites to be affected by light (too) and discovered that this works by setting normals to true and then by setting the shader to SVG Importer/.../Solid Color Diffuse Opaque (the sprites are rendered as opaque). This looks nice, but the problem is that for some reason the settings are being lost when I restart Unity. After restart, the sprites are set to the default Solid Color Opaque again. I have only a limited understanding of these shaders at this point and probably do something wrong, but perhaps you (or anyone) can give me a pointer.

    Thanks in advance
     
  46. Hintofox

    Hintofox

    Joined:
    Aug 14, 2017
    Posts:
    5
    i am having an issue with importing an SVG file, when i just drag and drop it like the videos say it adds it to my assets, but when i put into the scene and it creates the object, nothing shows up i don't know if i did something wrong or was it SVG file i have included a link for the file
    https://t.co/yjp5MZDo7i , and when i try to use the SVG editor it says to use one asset, when it is the only asset selected.
     
  47. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    167
    @Jaroslav-Stehlik, I found a bug with MSAA in unity 5.6 (and 2017) build WebGL ver 1.0. In 5.5 MSAA is work well, but in 5.6+ it disables. After some experiments, I understand - it's due to Camera.onPreRender += OnAtlasPreRender; which invoke RebuildAtlas(); after commenting it - MSAA is work in webGL 1.0 unity 5.6 now.
    In webGL 2.0 it work with it, and with image effects, etc. But webGL 1.0 have limitations, and it's not clear what Camera.onPreRender disables MSAA.
    Also not only Camera.onPreRender disables MSAA, it can be HDR on main camera (in my test project HDR is on by default, and MSAA not worked without SvgImporter).
    WebGL 2.0 is not enabled by default on my firefox (latest) and my collegue's PC firefox and chrome, and may be in many of out potential users; in my chrome webGL 2.0 is enabled, and unity 5.6 build MSAA is works fine.
    Strange what unity 5.5. build works ok in firefox and chrome on webGL 1.0, but support don't research this very deep.

    p.s. also you need to disable AddFakeCamera() which create new camera. may be with HDR?
    after disabling AddFakeCamera(); and Camera.onPreRender - MSAA is work 100%. But after only disabling Camera.onPreRender not enough.

    now I have troubles with gradients.
     
    Last edited: Sep 26, 2017
  48. AlexHell

    AlexHell

    Joined:
    Oct 2, 2014
    Posts:
    167
    @Jaroslav-Stehlik after final research, you need only patch code with
    AddFakeCamera()
    {
    ..
    camera.allowHDR = false;
    }

    now MSAA in webGL 1.0 in unity 5.6+ works fine.
    It's due to HDR enabling by default on every camera: created on runtime, or when convertion 5.5 to 5.6 project on scene cameras too.
    gradients is ok due to rebuild gradients.

    p.s. also user can disable HDR totally in tier settings.
    I have found what you need AddFakeCamera (which invokes public void OnPreRender -> then OnAtlasPreRender) OR Camera.onPreRender += OnAtlasPreRender but not both. and you definitely not need
    protected void Update()
    {
    Camera.onPreRender -= OnAtlasPreRender;
    Camera.onPreRender += OnAtlasPreRender;
    }
     
    Last edited: Sep 26, 2017
  49. Grazer2

    Grazer2

    Joined:
    Jun 20, 2011
    Posts:
    86
    I'm also here to report that anti aliasing is broken for me when using a Screen Space - Overlay canvas. This basically forces me to replace all those neat svg images with regular images :(
     
  50. vitorenes

    vitorenes

    Joined:
    Sep 17, 2013
    Posts:
    10
    Hello.

    Has anyone found a solution for this error:

    Cannot Load SVG Importer Settings! Please Move SVG Importer Settings in to Resource folder.
    UnityEngine.Debug:LogError(Object)
    SVGImporter.SVGImporterSettings:get_Get() (at Assets/SVG Importer/Plugins/Core/Data/SVGImporterSettings.cs:21)
    SVGImporter.SVGImporterSettings:UpdateAntialiasing() (at Assets/SVG Importer/Plugins/Core/Data/SVGImporterSettings.cs:52)
    SVGImporter.SVGAtlas:OnAtlasPreRender(Camera) (at Assets/SVG Importer/Plugins/Core/SVGAtlas.cs:422)
    SVGImporter.SVGAtlas:OnPreRender() (at Assets/SVG Importer/Plugins/Core/SVGAtlas.cs:397)

    I've tried (almost) everything, to no good. I don't know what else to do, and I am getting a little desperate.
    I'd appreciate any help. I am using the latest version (1.1.6), and I don't know if it's because of this error, but I have no antialiasing working either.

    Thanks in advance.