Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I'm looking for a high performance vector graphics library I can use in my games.

I'm thinking along the lines of vector graphics such as those that can be made with SVG.

I'll consider any language at the moment (but must run on Windows). A solution that takes advantage of GPU hardware would be great.

Thanks in advance.

share|improve this question
    
Is there any reason you want to use Vector Graphics? –  AttackingHobo Oct 25 '10 at 2:24
    
Yes: I like the style, they can compress better than textures and they are more flexible for animation. –  CiscoIPPhone Oct 25 '10 at 7:17
add comment

5 Answers

If Windows (Vista and beyond) is your only platform you should look into Direct2D, which provides GPU accelerated 2D vector graphics rendering with software fallback. For a more x-platform solution look into Cairo, which I believe to have a GPU accelerated rasterizer.

share|improve this answer
    
Interesting, I had never heard of Direct2D before. It doesn't seem to be widely used - perhaps because of it being Windows 7 only. –  CiscoIPPhone Oct 24 '10 at 16:27
    
It is Vista and Windows 7 only, due to the use of Direct3D 10. And it is rather new :) –  boki Oct 25 '10 at 2:11
2  
Note that several high-profile game programmers consider Direct2D awful - braid-game.com/news/?p=455 (which also links to a podcast) and braid-game.com/news/?p=466. –  user744 Oct 25 '10 at 18:01
    
I think the managed wrapper for Direct2D tends to be much easier to work with than the native library. And most of the criticisms I've read of Direct2D have cited examples where the same ends can be accomplished relatively easily in Direct3D. Sure, it's overkill to draw a rectangle, but it works well for curves and shapes with nontrivial texturing and/or stroking. Besides, D2D wasn't aimed primarily at game developers--it was intended to provide a richer, more performant alternative to GDI. But it does interoperate well with Direct3D. –  Mike Strobel Oct 25 '10 at 18:57
add comment

OpenVG is a standard for hardware accelerated vector graphics. It is supported by GPUs targetted for handheld devices, such as Mali / PowerVR / Vivante. Qt and Cairo can use OpenVG as a rendering backed. There are software libraries that implement OpenVG using OpenGL hardware (MonkVG, AmanithVG GLE) or software only (AmanithVG SRE, ShivaVG, AlexVG).

share|improve this answer
add comment

Scaleform GFx is a commercial middleware library for integrating Adobe Flash movies (optimized rendering, ActionScript, and more) into your engine.

In a past life, Scaleform GFx's codebase was that of GameSWF. GameSWF is open source.

I planned to add more to this answer, but by the time I got back to it, most of main points I wanted to hit on were mentioned in other answers.

The only other thing I can think to mention that's relevant to the Flash-based approach is the fact that Adobe has released the source code to their ActionScript virtual machine, which now lives at the Tamarin Project at Mozilla.

share|improve this answer
add comment

If you are using windows XP or want something that works on most versions of windows, you should check out DirectDraw (even though it's a little old now) or GDI+, or you could use Flash, which seems pretty good for vector rendering, and is cross platform.

share|improve this answer
    
DirectDraw has been deprecated for some time now, and as far as I know, it has no native capabilities for rendering vector-based graphics. My recollection is that it relied entirely on textures and blitting. I believe GDI+ is unaccelerated and GDI, while accelerated, is rather primitive. It would be better to go with a library like Cairo, which supports multiple renderers, at least one of which supports GPU-accelerated rendering. Direct2D is probably the best choice for Vista and 7. –  Mike Strobel Oct 25 '10 at 19:04
    
My bad, I thought GDI+ was accelerated! I guess Direct2D would be the best choice then as you say. –  dotminic Oct 27 '10 at 16:20
add comment

There's some discussion here and there on how to work SVG graphics into the XNA game engine. One here: http://wam-games.com/2010/04/svg-in-xna/ and here's a post on this very site: http://gamedev.stackexchange.com/questions/2196/rendering-svg-art-directly-in-xna

XNA pipes pretty much everything through Direct3D as I understand it, so it's all GPU accelerated. You basically must program in C# to use it (you can kind of use other languages, but you have to hack at it.) Using XNA gets you Windows for sure, but also the possibility of porting to XBox360 and a couple of portable platforms.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.