Does LÖVE Support .svg Files?
Posted: Wed Feb 01, 2012 9:20 pm
Excuse me, but I have been thinking of using vector graphics for my LÖVE project. Can I use .svg files in LÖVE, or must I be forced to use bitmap images?
It's not about performance issues but about the things that you can do with vectors that you cant do with raster formats like zooming to infinite and don't have quality loss or change colors on the fly in chosen elements of vector "image", etc. It's not the same category of graphics. It would be like have a kind of "flash" manipulation in Lua/LOVE.Taehl wrote:I'd recommend exporting your .svg to .png instead of .bmp. Superior format in every way. It's not that bad that Love2D doesn't support vector images, actually - graphics cards are designed from the ground-up to perform raster work, so you'll be using available hardware as best as possible by using raster.
http://levelbuilder.karnakgames.com/doc/Corona SVG Level Builder is a set of libraries to be used in a Corona SDK game that allows you to create Corona SDK physics based games, levels and maps by just drawing in the free and open source vector drawing Inkscape. Everything you draw in Inkscape is automatically converted into Corona physics bodies or paths.
The thing is, LÖVE is hardware accelerated and graphics cards just aren't designed for that. The next best thing would be to convert to a rasterized image based on the scale, which you can sort of do already, although it might not be as convenient.coffee wrote:It's not about performance issues but about the things that you can do with vectors that you cant do with raster formats like zooming to infinite and don't have quality loss or change colors on the fly in chosen elements of vector "image", etc. It's not the same category of graphics. It would be like have a kind of "flash" manipulation in Lua/LOVE.
Slime I agree that raster processing have an older and more faster/direct support, but nowadays browsers and "HTML5" interpret and do SVG render even in mobile plataforms, Flash do it in a compiled way for ages an alternative vector render support. 3D videogames use math and vector operations. Even LOVE already operate well with vector basic operations and the base support is there. Aren't really graphic cards so not designed for that? I would think GPU are well prepared to deal with math operations and vectors long time ago. Do it in a vector or raster form is more a choice, not always speed is intended. Following your thought in a parallel way we should avoid scripted languages just because compiled code are faster/more direct running in CPU.slime wrote:The thing is, LÖVE is hardware accelerated and graphics cards just aren't designed for that. The next best thing would be to convert to a rasterized image based on the scale, which you can sort of do already, although it might not be as convenient.coffee wrote:It's not about performance issues but about the things that you can do with vectors that you cant do with raster formats like zooming to infinite and don't have quality loss or change colors on the fly in chosen elements of vector "image", etc. It's not the same category of graphics. It would be like have a kind of "flash" manipulation in Lua/LOVE.
http://http.developer.nvidia.com/GPUGem ... _ch25.htmlModern graphics processing units excel at rendering triangles and triangular approximations to smooth objects. It is somewhat surprising to realize that the same architecture is ideally suited to rendering smooth vector-based objects as well.
For svg try this:coffee wrote:Here some Lua bindings to Cairo (don't know if SVG is already implemented):
Well about that I can't say much more than that XTUX345 will need for a while do only basic vector stuff in LOVE.bartbes wrote:The biggest problem with this, when we last looked at it, that svg libraries are huuuuuge, and we're talking about doubling the size of love here.