SVG support ?

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

SVG support ?

Post by TsT »

Hello,

Is it planned to support SVG image format ?
Or is it too complicated or not really compatible ?

Regards,
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
User avatar
nevon
Commander of the Circuloids
Posts: 938
Joined: Thu Feb 14, 2008 8:25 pm
Location: Stockholm, Sweden
Contact:

Re: SVG support ?

Post by nevon »

It's something that a lot of people would like, but apparently it's really hard to do.
User avatar
Ertain
Citizen
Posts: 55
Joined: Fri Nov 19, 2010 9:38 pm
Location: Texas, U.S.A.

Re: SVG support ?

Post by Ertain »

It would be really cool if it could be coded. Yeah, you have to mess around with a lot of XML and vector stuff. Still, it would be really useful, such as with different resolutions. Heck, I'd even pay money to have that feature.
Booted, suited, and ready to get executed.
User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: SVG support ?

Post by genericdave »

This would be an insanely huge undertaking. As far as I know, the only active library that does this is Qt4. There's no way we'll be seeing this happening in love unless some sort of amazingly awesome, open sourced, actively maintained, easily pluggable library suddenly springs into existence. Even then, it would take a lot of work to plug it into löve.

SVG is not what löve set out to do. If what you want is non-rasterized images, you can draw shapes manually. Otherwise, you should just rasterize you SVG shape and feed it into löve the standard way.
User avatar
Taehl
Dreaming in associative arrays
Posts: 1025
Joined: Mon Jan 11, 2010 5:07 am
Location: CA, USA
Contact:

Re: SVG support ?

Post by Taehl »

I would also like to point out that SVG, in my (somewhat-extensive) experience, is slow to render. Far too slow for realtime graphics. Why not export your SVG to PNG? Even a 1024x1024 32-bit color PNG can be rendered a thousand times faster than a moderately complex SVG.
Earliest Love2D supporter who can't Love anymore. Let me disable pixel shaders if I don't use them, dammit!
Lenovo Thinkpad X60 Tablet, built like a tank. But not fancy enough for Love2D 0.10.0+.
User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: SVG support ?

Post by genericdave »

I'm surprised. Aparrently, Cairo has something implemented. Who knows? Maybe this is more feasible than I thought. We just need an uber-programmer to come along and do the black magic necessary to implement it (I guarantee it would be complicated as hell).
User avatar
ivan
Party member
Posts: 1911
Joined: Fri Mar 07, 2008 1:39 pm
Contact:

Re: SVG support ?

Post by ivan »

Taehl wrote:I would also like to point out that SVG, in my (somewhat-extensive) experience, is slow to render. Far too slow for realtime graphics. Why not export your SVG to PNG? Even a 1024x1024 32-bit color PNG can be rendered a thousand times faster than a moderately complex SVG.
Depends, if you load the graphics ahead of time it might be ok. SVG-quality graphics are possible in realtime although (in my experience) not very useful. Check out the demos (agenoria.exe) in my own little engine (and bitter Love rival :)):
Image Image
Notice that these are not SVG files loaded directly. I wrote a .PS converter since the .PS format is very close to the 'canvas' interface used by the engine. SVG to PS conversion is trivial using Inkscape and other similar programs. The results are not perfect of course and when you zoom in you'll notice that the tiger has some artifacts. SVG has many features that would be a lot of work to reproduce in realtime such as different gradients and so on.
I'm surprised. Aparrently, Cairo has something implemented. Who knows? Maybe this is more feasible than I thought.
If you plan on implementing a 'canvas' interface then you'll be moving into scene graph territory since the 'canvas' has to store its geometry. Nothing wrong with that, but I think that the Love API would have to be redesigned quite a bit.
User avatar
bartbes
Sex machine
Posts: 4946
Joined: Fri Aug 29, 2008 10:35 am
Location: The Netherlands
Contact:

Re: SVG support ?

Post by bartbes »

If anything, the SVG would be rendered at load, then that render could be used. Using the vector data directly would be slow, hard, and oftentimes would provide no direct advantage.
User avatar
genericdave
Citizen
Posts: 53
Joined: Tue Dec 15, 2009 9:08 am

Re: SVG support ?

Post by genericdave »

ivan wrote:Check out the demos (agenoria.exe) in my own little engine (and bitter Love rival :))
I would if it ran on something besides windows. Get that thing up and running on the three major operating systems and give it a clear, liberal license (for the binaries, I mean). Then we'll start talking about "rivals." :P
User avatar
TsT
Party member
Posts: 161
Joined: Thu Sep 25, 2008 7:04 pm
Location: France
Contact:

Re: SVG support ?

Post by TsT »

bartbes wrote:If anything, the SVG would be rendered at load, then that render could be used. Using the vector data directly would be slow, hard, and oftentimes would provide no direct advantage.
It should be usefull to be able to :
- provide one SVG image (small size)
- be able to render it at startup in multiple size (maybe also large size).

But I understand that is a hard work to provide a feature usefull only in so few cases.

Thanks
My projects current projects : dragoon-framework (includes lua-newmodule, lua-provide, lovemodular, , classcommons2, and more ...)
Post Reply

Who is online

Users browsing this forum: No registered users and 85 guests