12
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ Is there any reason you want to use Vector Graphics? \$\endgroup\$ Oct 25, 2010 at 2:24
  • \$\begingroup\$ Yes: I like the style, they can compress better than textures and they are more flexible for animation. \$\endgroup\$ Oct 25, 2010 at 7:17

5 Answers 5

7
\$\begingroup\$

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.

\$\endgroup\$
4
  • \$\begingroup\$ Interesting, I had never heard of Direct2D before. It doesn't seem to be widely used - perhaps because of it being Windows 7 only. \$\endgroup\$ Oct 24, 2010 at 16:27
  • \$\begingroup\$ It is Vista and Windows 7 only, due to the use of Direct3D 10. And it is rather new :) \$\endgroup\$
    – boki
    Oct 25, 2010 at 2:11
  • 2
    \$\begingroup\$ 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. \$\endgroup\$
    – user744
    Oct 25, 2010 at 18:01
  • \$\begingroup\$ 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. \$\endgroup\$ Oct 25, 2010 at 18:57
3
\$\begingroup\$

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).

\$\endgroup\$
2
\$\begingroup\$

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.

\$\endgroup\$
0
1
\$\begingroup\$

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.

\$\endgroup\$
2
  • \$\begingroup\$ 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. \$\endgroup\$ Oct 25, 2010 at 19:04
  • \$\begingroup\$ My bad, I thought GDI+ was accelerated! I guess Direct2D would be the best choice then as you say. \$\endgroup\$
    – dotminic
    Oct 27, 2010 at 16:20
1
\$\begingroup\$

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: 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.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged .