0 votes

I'm trying to import an SVG into Godot Engine.

Currently, for some reason, the SVG imports (and shows up in the resource browser) as a 1x1 brown texture: http://prntscr.com/ibnjua

What it should look like: http://prntscr.com/ibnjnv

Changing the scale only works on certain types of exports (I'm using Affinity Designer to make the SVGs, and there are around 4 different export options - print, web, flatten, etc.), and only seems to work up to around 40x40 - no use when my image is 1920x1080.

Anyone got any ideas why this is? Should I just use PNGs instead?

Thanks

in Engine by (17 points)

2 Answers

+1 vote
Best answer

SVG rasterization in Godot relies on the nanosvg library, which is small and does not implement the full SVG 1.1 specification. The SVG specification is huge; no small, permissively-licensed library supports it fully.

Except for very simple vectors, it is suggested to render PNGs using vector software instead. This process can be automated using scripts; for example, Inkscape offers CLI functionality for exporting vectors to various image formats.

by (12,869 points)
edited by
+2 votes

I would suggest using png instead -- other formats are iffy.

by (59 points)
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 Frequently asked questions and 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 [email protected] with your username.