Hi guys, i am wondering when will we be able to use a scalable .svg in Godot ? as i want to use svg for Ui design to get a perfect resolution at any window size, i wanted to know from you guys if someone knows when this will be available or if there is an other solution at this time. thx

uriel

15 days later

i take the oportunity to up this topic... i am sure people use SVG graphics in their games !, no ? please, repport any experience with it and any informations regarding the use of SVG capabilities in godot :) thank you

uriel

I've none, but one though that occurs is perhaps to create a importer for svg's and process the data into polygon 2d's? Likely going to enable only partial support for the SVG data perhaps though. I'm not too familiar with the SVG data-structure though, so take it with a grain of salt, but it's a thought.

i am very suprised that svg is not supported from the beginning, as it is so used for mobile devices UI and html5. i really consider looking at this option in my future projects, looking forward how can i help in this direction... thx @Megalomaniak

if you talk about real time scale vector graphic to use svg or any other vector format, render engine need special render for that vector-scalable format its very complex to make it low-cost in real time middle-tier GPU can do few (1-2 I think) vector image on screen at same time https://twitter.com/EricLengyel/status/1182927319658139648

if you talk about static prerendering for svg images, then you can connect any simple svg render using GDNative, or just convert all svg images to *.png outside of godot

P.S. you can do cheap-trick, to have it scalable and low cost in real time image (still little complex) render source svg to many images with different size(from 512x512 for far distance), biggest like 10k(cut it on 2k textures-tiles) and use them same like LOD, loading needed texture base on camera position to this mesh with texture

@Megalomaniak said: create a importer for svg's and process the data into polygon

Blender can render SVG to polygons (layer by layer with color-material for each). Still static solution

18 days later

SVG rendering is essentially little different from the rasterization of 3D graphics. You take mathematically calculated and stored data, and render it to pixels. The primary difference being the inclusion of mathematically calculated curves where most 3D interpreters are based on vertex and polygon data.

The reason why no one in game engines seems to support SVGs is that is because they are often more costly to render than 3D graphics, largely thanks to the previously mentioned smooth curves. Calculating curves frequently involves more computational overhead than just connecting existing vertex data. It's much less costly to render a vector image once, and then use that rendering until a different version is required.

You could compare it to real-time lighting and baked lighting. Real-time lighting can look better, and be more responsive. But baked lighting is WAY better for a game's performance. Constantly rendering SVGs would be terrible for a game's performance, while rendering an SVG to a series of different-resolution PNGs is much less costly. (and can provide similar functionality) Most people go for the latter approach.

I love vectors and SVGs. I use them all the time for graphic design. But if I wanted to use a vector approach in a game engine, I would probably limit myself to 3D graphics that I render to a texture.

5 years later

If Godot 4 fully integrates SVG support for textures (as in TileMap, AnimatedSprite, etc.), it could become one of the most widely used game engines on the market. Vector images represent the future of graphics: they enable the creation of visuals that are clean, scalable and incredibly light in terms of storage and performance.

Today, more than 60% of developers are looking for an engine capable of handling SVG natively, as it offers unrivalled flexibility for the creation of high-resolution games, without compromising performance. SVG can reduce the size of graphic assets by 30-70% compared with traditional bitmap formats, while maintaining perfect image quality at any scale.

With an effective implementation of SVG, Godot could see its adoption curve soar and establish itself as an essential reference in 2D and 2.5D game development. The addition of this technology would meet a real need and could position Godot as the engine of choice for a new generation of developers in search of power, optimization and modernity.