Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


How Useful is SVG?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
9 replies to this topic

#1 Vincent_M   Members   -  Reputation: 744

Like
1Likes
Like

Posted 27 August 2013 - 01:54 AM

By the looks of it, SVG seems like the 2D doppleganger of COLLADA:

-They both have XML-based DOMs

-They're both quite complex interim formats

-Both seem to be open formats aimed for wider support application support than other formats of their kind

 

How suitable is SVG for animation? I've read that it's mainly for static images, but then I've also seen information that could be for animation manipulation for SVG 1.1, but I'm not quite sure. I'm on a vendetta for finding an open, vector-based solution for generating computer graphics for 2D games since rasterized graphics, although have their advantages over vector graphics, are just too memory-instense for my purposes.



Sponsor:

#2 dave j   Members   -  Reputation: 599

Like
2Likes
Like

Posted 27 August 2013 - 04:48 AM

I think the problem you might have with using SVG directly is rendering speed for use in games. Many mobile GPUs support OpenVG in hardware and Nvidia have an OpenGL extension that can render it which will both help but I don't know how quick they are. For other GPUs there are some libraries that attempt to render SVG or OpenVG using OpenGL (See Sugar and ShivaVG).

The big problem you might face is different rendering speeds for more complex objects. With rasters, everything is just a rectangle so rendering speed is based on size. With vector shapes, more detail, particularly if your shapes have many complex curved paths, clip paths, etc. will take longer to render. You might want artists to avoid using particularly slow to render features.

#3 Vincent_M   Members   -  Reputation: 744

Like
0Likes
Like

Posted 27 August 2013 - 11:28 PM

I've wondered about the performance concern myself since curves could use varying resolutions to make them rounder. I haven't invested too much time into research but I'd imagine an SVG is a collection of depth-sorted layers made up of shapes which are made up of a collection of curves which could tip the vertex count quickly

#4 samoth   Crossbones+   -  Reputation: 5031

Like
0Likes
Like

Posted 28 August 2013 - 08:30 AM

I tested the nVidida extension demos some months ago. Even on my rather modest 650Ti it's super fast, drawing and transforming SVG images such as "the tiger" as if they were textures. With transparency and all, freely scalable, and antialiased. Super awesome.

 

The only thing that sucks about it is that it's not supported on any other vendor, and nVidia actually added way too much, so it likely will not ever make it into ARB or even core.

 

The extension supports not only rendering SVG paths, but also outline text, and some PostScript-like custom format, and it's directly programmable via a special API, too.

It would be cool if they'd just scratch 90% of that and keep SVG path rendering (or alternatively the custom format, which you can trivially generate from SVG), and it was made a core feature. But as it is, it's pretty useless, since you must implement your own SVG drawing anyway to account for other vendors. And since you have to do that, you don't need the extension.


Edited by samoth, 28 August 2013 - 08:30 AM.


#5 Krohm   Crossbones+   -  Reputation: 3240

Like
0Likes
Like

Posted 29 August 2013 - 12:53 AM

I have been doing vector graphics on GPU using blinn-loop accelerated path rendering for years about now. Rendering vector graphics can be very, very, very fast (on everything that is at least GeForce 6) albeit I must admit my rasterizer produces terrible aliasing. Going back to original question:


How suitable is SVG for animation?

I'm inclined to say "useless". I'm trying to diversify right now so I'm studying web technologies. SVG animation doesn't even work in Gecko and what works in Gecko doesn't work in other browsers. Even taking the browser factor out of the picture, it looks to me it's just too complex to be used in games and the idea of implementating it makes me shiver.

I'm currently inclined in just using bezier triangles for everything.



#6 Krypt0n   Crossbones+   -  Reputation: 2627

Like
0Likes
Like

Posted 02 September 2013 - 02:15 AM

I've written an svg triangulator, it works nicely on every platform for rendering (e.g. 60fps with AA on iPad1).

but in regards to animation, I just go for rigid bodies. I wouldn't know a tool that animates SVG, I use InkScape so far and it's neat for non-animated stuff. (but hints are welcome :) )



#7 Olof Hedman   Crossbones+   -  Reputation: 2947

Like
0Likes
Like

Posted 02 September 2013 - 02:46 AM

I don't think SVG is very good for anything realtime. It seems to be designed more with the artist in mind, then with performance or ease of implementation.

It also seems to try to be one of those über-formats that tries to support everything and then some.

That usually leads to specification monsters, and pretty much no implementations that support it to 100%.

 

If you don't have to write the renderer for it yourself, I think it might be useful as a storage format though, specially if you want to support many different screen sizes without the distributable grow too big.

Then I think SVG could be useful, but you wouldn't draw it in realtime, just render up the graphics to bitmaps in the resolution you want, and use the bitmaps.

 

If you want to animate some paths, lines etc, its probably a lot easier to just implement drawing some paths and lines, and make an engine tailor made for this, and ignore the full SVG specification.



#8 Krypt0n   Crossbones+   -  Reputation: 2627

Like
0Likes
Like

Posted 04 September 2013 - 04:12 AM

Then I think SVG could be useful, but you wouldn't draw it in realtime, just render up the graphics to bitmaps in the resolution you want, and use the bitmaps.

 

But then you'd loose one of the nice points of vector graphics, which is resolution independence.

Especially on Android, where you have to deal with some 320x240 low end screens up to 2560x1600, having your SVG rather triangulated than pixelated might be of an advantage.



#9 samoth   Crossbones+   -  Reputation: 5031

Like
1Likes
Like

Posted 04 September 2013 - 05:12 AM

 

Then I think SVG could be useful, but you wouldn't draw it in realtime, just render up the graphics to bitmaps in the resolution you want, and use the bitmaps.

 

But then you'd loose one of the nice points of vector graphics, which is resolution independence.

Especially on Android, where you have to deal with some 320x240 low end screens up to 2560x1600, having your SVG rather triangulated than pixelated might be of an advantage.

Not so, you render your SVG to a bitmap when the program starts up, once, and in a suitable size. And then you use the cached bitmap, which will work well for the device's resolution, no matter what it is.

 

That way you have the best of two worlds: acceptable performance, and resolution independence. It isn't even a speed/memory tradeoff, since if you were to use bitmaps in the first place, you'd need the same memory to store these, too.



#10 dougbinks   Members   -  Reputation: 489

Like
1Likes
Like

Posted 14 September 2013 - 08:03 AM

If you're interested in SVG, Mikko's NanoSVG is pretty handy.

 

An interesting alternative is to use a font if you already have font loading & rendering. You can make fonts from multiple SVG files using various tools, and then load then using and render them using whatever GUI or Font system you use, scaling to the appropriate size for your screen resolution.






Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS