[gameprogrammer] Re: Vector Graphics (seconded request)
- From: Jon Harrop <jon@xxxxxxxxxxxxxx>
- To: gameprogrammer@xxxxxxxxxxxxx
- Date: Tue, 9 Nov 2004 19:10:12 +0000
On Tuesday 09 November 2004 18:10, Bob Pendleton scrawled:
> I wrote:
> > As the author of Smoke, I can comment on what I have done which is new:
> > Smoke can render vector graphics around two orders of magnitude more
> > quickly than software-based renderers (such as those found in current
> > Adobe and Corel software) partly by using hardware acceleration and
> > partly through the careful selection of appropriate data structures and
> > algorithms.
>
> What you did was discover that the hardware designers had already put
> all the functionality you needed into the hardware and you used it by
> means of a library such as OpenGL or DirectX...
There are many ways to render vector graphics using OpenGL. All of them are
complicated. Most of them are needlessly inefficient. I have evolved a
program which renders them efficiently (both asymptotically and the constant
factor).
Essentially, marrying the rendering of these kinds of vector graphics with
rendering using OpenGL is rather tricky, primarily because these topics
evolved independently, until now.
For example, if you draw a line stroked with an arrow head in PostScript, then
any affine transformations applied to this object only affect the underlying
skeleton and not, for example, the arrowhead. This is in direct contrast with
conventional rendering using OpenGL, where transformations affect everything
further down in the scenegraph/tree. Thus, with Smoke I chose to follow the
OpenGL convention as this allows transformations to be hardware accelerated.
With some jiggery pokery, the results can even be exported to PS.
> > This is a
> > very difficult task and one which had never been addressed previously, to
> > the best of my knowledge.
>
> You really need to read some history.
While it is true that vector graphics have been used in one form or another
for many decades (wasn't Bresenham's line algorithm 1965?), these kind of
vector graphics are only about 15 years old. The way in which Smoke renders
such graphics is only a few years old.
> There are reasons why all the
> functionality you needed was already there. It is because the need for
> the functionality has been worked out over the last 50 years and
> hardware and software were built to give it too you.
Rendering these kinds of graphics was totally unfeasible 20 years ago, let
alone 50! Rendering them this efficiently has only been feasible for about 5
years. Hence, I believe things are about to change and we'll see completely
vector GUIs built into ordinary OSs. Apple have hinted at this but they have
achieved little more than textured quads so far. Microsoft mumbled something
about Longhorn and bought a few companies (I'm for sale!).
> Adding a higher
> level interface to the functionality is a valid and useful activity, we
> would all hate to have to work in machine language just as much as we
> would have to write out individual OpenGL commands for every tiny
> triangle in a complex image. But, in the end you are only exposing
> functionality that was all ready there.
You can't stroke and fill a contour with an OpenGL call, it takes thousands of
calls. You'd have to implement part of Smoke to do it. I'd call this adding
new functionality. If you don't call this adding new functionality then the
dedicated hardware doesn't add any new functionality either. And the CPU
doesn't need all of those registers...
> You are taking advantage of the
> new rendering hardware to convert geometry into pixels.
Oh yeah, baby.
Cheers,
Jon.
---------------------
To unsubscribe go to http://gameprogrammer.com/mailinglist.html
- References:
- [gameprogrammer] Re: Vector Graphics (seconded request)
- From: Jon Harrop
- [gameprogrammer] Re: Vector Graphics (seconded request)
- From: Bob Pendleton
Other related posts:
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- » [gameprogrammer] Re: Vector Graphics (seconded request)
- [gameprogrammer] Re: Vector Graphics (seconded request)
- From: Jon Harrop
- [gameprogrammer] Re: Vector Graphics (seconded request)
- From: Bob Pendleton