2d Higher level API - SVG - Universal Canvas

Since OpenGL is the 2d-3d API that can run in software or hardware on the biggest number of platform, it’s the most logical choice for supporting the drawing standards defined by the SVG working group at the W3c.

The w3c’s browser (Amaya Opengl version) demonstrates it as it renders basic SVG, with relatively few opengl code.

I don’t mean that opengl API should include a XML parser, but the undelying functions needed to render SVG.

SVG express the 2d needs of all 2d application, as it has been defined by the major actors of the 2d world. It’s the format that will be use for all network graphics transfer on all computer, handheld device and even Phone (look at the mobile specification)

Integrating the API in OpenGL means that users will experience their documents using the latest technologies avalaible in graphics chipsets. Best of all is that it will not depend on a device or an os but only on OpenGL.

Why limiting Opengl only to 3d applications or games ?

2d use of Opengl are gorwing every day, with Amaya, GLUI, FTGL, MacOSX, GL version of SDL, GL version of the Flash player…

I think OpenGL is the best suited API to be the foundation of the universal canvas, and SVG is the most standardized way to do it.

The missing step is to give OpenGL the ability to include SVG drawing primitives natively, so that all canvas can be accelerated.

[This message has been edited by Kuranes (edited 05-16-2002).]

What primitives aren’t already accelerated? Text rendering obviously, but the chances of that making it into gl are nil :]. The rest seem like basic polygon, line, point etc. and simple convolutions.

Here’s the SVG spec if anyone’s interested: http://www.w3.org/TR/SVG/

Yes, Most of SVG are already implemented in OpenGL. but adding Basic shapes, ellipses, path, all with outlines and filling, painting them with gradients (linear or radial), filters, stroke line-join, line-cap, skew could help a lot.

I just suggest to create function a little higher level in 2d, choosing the SVG model, because it has been specified by the major actors of the 2d canvas, therfore we can have a very solid 2d foundation.

This isn’t much coding and could be relatively easily integrated in opengl (at least the mobile profile), so that using OpenGL in 2d is as eassy as drawing in SVG.

The final point is to use OpenGL 2.0 as the main basic architecture of all graphics chipset, as being capable of drawing SVG means that you can do anything in 2d, and in an accelerated way, on any platform, with very few code !!

So it will help :

  • OpenGL hardware integration,
  • software developpers and
  • content creators as they can count on an universally supported standard.

(but perhaps i’m repeating myself ?

I can’t see anything on that list that couldn’t be easily implemented in the already proposed OpenGL 2.0. Gradients? 1D texture. Filters? Shaders. Fancy line stuff? Turn it into tris.

Remember that OpenGL is a low-level library. It’s there to provide a minimal set of well-defined primitives. Ellipses and funky line styles need not apply.

Making a library that sits between an app and OpenGL (a la glu) would be a better idea.

Low-level and external library

Low-level does apply in 3d programming, as the minimal set of primitives is tris… and any other will be too invasive on the 3d engine conception.

In the 2d world, SVG primitives are the minimal set of well defined primitives. If you want the use of OpenGL for all graphics, you may need to provides developper more than actual OpenGL primitives, so 2d OpenGL developpers doesn’t need to be 3d guru to implement 2d drawings :
Using tris for line-cap or line-join is for sure a 3d guru idea but couldn’t have been born in a 2d developper brain…

External library :

As you said it’s not lot of work, but it will prevent reinventing the wheel at every 2d use of OpenGL. A library is also a set of the most reutilizable functions.

SVG support in OpenGL is the way of becoming the underlaying graphic of all application (3d AND 2d), using SVG definition of 2d minimal set that have been well defined by the w3c’s workgroup, so that it covers all 2d needs.

Svg Direct Hardware Support is more likely to be implemented if in the main openGL library.
And that’s the goal of my propostion.

[This message has been edited by Kuranes (edited 05-21-2002).]