Ragespline which supported it before appears to be discontinued and unsupported, it won’t even compile according to reviews.
What other solutions are there we could use?
Ragespline which supported it before appears to be discontinued and unsupported, it won’t even compile according to reviews.
What other solutions are there we could use?
SVG Importer | Vector Graphics Plugin for Unity
Unity 4.6.0 Compatible, fully cross-platform.
Easily drag and drop your SVG files directly in your scene. SVG importer fully mimics Unity native sprites so your team doesn’t have to learn anything new. Extremely fast and simple workflow for rapid level design. Resolution independent graphics ready for retina displays and full support of the new Unity UI system.
SVG importer automatically converts SVG files into highly optimised meshes and does fully supports both
linear and radial gradients.
Features
SVG Importer fully Supports
I’ve been looking as well. I’ve only found 2 options and neither work well.
First there is Allegorithmic’s Substances which seems to not support radial gradients. When you try to import radial gradients it will either not render or crash Substance Designer. Also this costs like 500 bucks, but you can also download the trial if you would like to feel my despair first hand.
The other option is a free open source plugin which you can get here: GitHub - MrJoy/UnitySVG: SVG renderer for Unity3D.
From what I’ve seen it doesn’t parse Illustrator svg files very well and the svg library it’s based on is pretty dated (from 2006). But at least with this you have the option to fix up the code.
Also both of those options render to texture before the game starts. So keeps your download size small, but doesn’t dynamically react to size changes like ragespline did.
Kinda makes you miss flash, doesn’t it?
Now you have another option:
SVGAssets: A runtime library for reading SVG files and render them on Texture2D objects (requires Unity Pro).
For projects that need to run across a wide range of devices, with different resolutions, SVGAssets simplifies your life: a single SVG file is enough, you won’t need to maintain multiple copies of the same texture image, at different resolutions, anymore!
The package includes a standalone SVG player based on the SVGAssets technology; this player allows you to test SVG assets before to use them inside your Unity projects.
Check the video tutorial: Video Tutorial
-
Depending on what you (or your company if there’s one) have been up to until now, Substance designer cost 99$ (or 198$ if you buy the pack which also include Substance Painter, Bitmap2Material, 30x 100% procedural textures (purely coded textures) and 50x semi-procedural textures (makes uses of normals and some diffuse map). (It’s called the Indie version/Pack)
It still only support non-gradient & non-stroked SVG arts so if you’re using either CorelDraw,Adobe’s Flash or Adobe’s Illustrator to make your images, there are some thing to take into consideration :
Ideally, flatten your image to remove any risks for the layers to be mixed out in case of a reading error. (Unlike pixel picture, whenever there’s a computation error within a vector picture, it will still render without any warning.)
“Expand” the artwork. This will allow every kind of strokes and gradient into flat-like color. For outlines, they’ll simply become forms (like everything else) and the gradient will turn into a divided bunch of lined forms of different color (based on the option you selected in the Expand tool). The tool may varies in each software. For the sake of your project, don’t exceed around 255 colors in total for a picture. Unlike pixel computation, vector computation is lighter in its global application, but it can easily become heavier (in CPU) as each color is separately calculated and, in the case of Unity or any game engine, it is then recalculated within the shaders. Ideally, if you want high quality gradient within your game on a SVG art, you should import the SVG file with pure flat colors inside of Substance Designer and then add the gradient/colors adjustment INSIDE of the software. (You can create vector masks inside of SD to allow procedural adjustment over each part of your art.)
Note that you can also “Expose” additional effect & colors adjustment inside of Substance Designer. For example, you can add exposure color values for the hairs and clothes of your textures in the materials used. This way, you can even make it so that you can change the colors while within Unity. If you want to allow the player to change the colors within the game, you can do it through saving upon the game’s cache. (Many tutorial around for that) If you don’t want to program or use the game’s cache for it, you can still use the exposed values inside of Unity and it just won’t “change” in-game. (Exposed values are similar to the Diffuse/Specular color pickers within existing Unity’s shaders)
This is what Substance Designer allow you to do with SVG.
Now, the reason why SVG isn’t natively supported within Unity is due to how SVG are, normally, managed. Like you can see in Ska0s’s answer, SVG are codes. Those codes follow a set of rules. The issue at hand is the SVG can’t be rendered “alone”. It require an additional rendering system even before being rendered on-screen. (That is why we say that SVG are scaleless. If you remove part which dictate the size of the SVG, it will still work and will fit the rendered screen by default. That’s not the case of EPS or AI which are both postscript images with strict sizing values.)
So, it would be possible to make SVG natively supported within Unity by adding specific values to the shaders. The issues would be that those shaders would have to connect to the web to search for the W3 information to know “how” to render the SVG (like how it’s done on the web). Substance Designer is limited to flat-colors with no strokes because it doesn’t make uses of the W3 information and only make use of binary vector coordinate (which is natively compatible with any computer).
This is what Ska0s’s SVGAsset is doing. It’s a pre-render which dictate to the SVG file how it should be rendering prior to the Unity engine’s render.
There is a new asset available in the store. It allows you to create entire scene in illustrator and import the file to unity.
Another option is to use NoesisGUI:
It reads XAML files but you can create an SVG in Inkscape and export it to XAML. If you need a more advanced SVG to XAML converter you can use ViewerSVG.
NoesisGUI renders the vector graphics in realtime (very fast!) either onto the screen or onto a RenderTexture.
It’s not out yet but take a look at LineWorks. It can import SVG into Vector/Mesh Data. Should be released very soon.
LineWorks Vector Graphics
Unity should support SVG graphics natively,Unity should support basic SVG natively. Its pretty needed.