looking for best svg library for situation

Godot Version

4.4.1

Question

i have looked multiple times for svg libraries and need to know which one would suit my needs, which are: 1: rendering efficiently, as i am targeting low end mobile devices and dont want some complex gpu shader method to slow down the game. 2: being infinitely scalable based on resolution, so it doesnt look pixelated to people with high res screens or waste vram on low res devices. 3: store the assets as actual svgs or some kind of export conversion that stays within the small size of svgs, so no bitmap conversions. 4: work on all the official exports of godot(except ios thats fine), so nothing about failing to compile on specific os+archetecture combos and being unusable there. and 5: not be super janky or really hard to work with.

It would help if you linked to the options you have found if you want evaluations.

However, based on what I’ve read, SVGs are not fully supported yet. It’s something the Godot team is working on, and hopefully will be in 4.6. So right now, as best I can tell - you are better off using mip-mapped pngs for different resolutions.

Hopefully someone else might have a better answer.

Godot 4.5 introduced DPITexture, which is close to what you need. However, it is still very raw, and I haven’t been able to get it to work properly.

You can try the SVG Rasterization Plugin, but it may be quite heavy, especially if you have a lot of complex SVGs.

Your requirements are extremely contradictory, and I doubt there is a solution that satisfies them all.

4 Likes

that is one of the ones i have tried, but it seems to have possibly broken in 4.4 as the camera node it came with changes zoom to something way too large every time i load the project and i cant change it and have that stay. have submitted an issue to its github incase it could be fixed

dpitexture seems good from what the documentation describes, might try that since 4.5 appears to be finished enough to start messing with it. ill report back my experience, but if i have issues i will definitely check back on it as the engine updates.

Having actually used SVG in production (on a Flutter/Dart project), I’m not sure I’d recommend SVG for actual use. I can’t tell you how many times I ran into problems where some SVG the customer supplied used a feature (like filters!) that wasn’t supported. I also can’t tell you how many times I cracked open an SVG to find a pixel image wrapped with “map this on a rectangle and stretch it”.

3 Likes

what im working on will have me be the one making the svgs (usually art made from scratch), so i can avoid that jank preemptively or learn something im trying to do isnt supported and just not do it again for whatever i make next.

1 Like

It worked for me in G4.4.1 and G4.5b7

dpitexture is good enough for me. from what i can see from the export it does store the actual svg data in some form, and i assume the auto scaling will just get better as the versions go, and its gonna be a bit before what im making releases so by the time it does this will have likely improved a ton. thanks everyone.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.