0 votes


in Engine by (39 points)

1 Answer

+3 votes
Best answer

There was a similar question about SVG support answered here. There's currently an open issue on github regarding supporting vector graphics, with the possibility of Godot 3.0 introducing support for 2d meshes.

In the meantime, there is a plugin as pointed out by jospic that will import and convert SVG files to PNG.

by (1,308 points)
selected by

thanks. support for 2d meshes means lossless scaling at runtime?

To answer your question, I would say simply, no.

For pixel based images, you can achieve better scaling with exporting/importing graphics as textures with mipmapping, it's an improvement, but certainly nothing loseless.

The meshes will be making use of textures and manipulating their UV mappings. So same technical restrictions.

You just won't ever get raster graphics to do what vector graphics do, especially in the way of infinitely scaling something. One is a file of fixed in place pixel data, and the other is just geometric information combined with style information that allows it to be redrawn dynamically.

If SVG gets converted to meshes, then... "yes", you can zoom in and out without too much loss, but there is a catch behind the scenes. For example, take a circle. Flash would render it as a perfect circle because it uses formulas to fill an image (no wonder why Flash is slow). On graphic cards, a circle is rendered with a polygon that has enough sides to be seen as a circle. You can zoom in and out of the circle without seeing "blurryness", however, you might be able to see the edges of the sides, depending on how much precision you have.

Converting SVG to meshes is basically the same as Flash would do when it renders vector graphics, however it will be done through approximation of all drawings by the use of polygons, that you can make more or less numerous for precision.

Textures are another matter. They will always have the same precision problems when you zoom, wether you draw them with Flash or Godot. If you vectorise them they will become lossless, but you still loose information in that process, they will look different.

There is a tradeoff to take. You can use SVG converted to meshes, but if that process produces too much geometry, then you are better off with a texture. However if your graphics are simple enough, they might be eligible for polygon-based vector graphics.

Nice. Thank you for your time :)

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.