On Tue, 2006-01-03 at 19:13 +0000, MJ Ray wrote:
Alex Hudson home@alexhudson.com
As an example of the kind of development that needs 3D hardware acceleration: http://www.mozillazine.org/talkback.html?article=6498
Why are they interested in Cairo rather than any 2d-friendly vector library? Can someone translate that page for non-graphics-fans?
I wouldn't rate myself a graphics fan, but I'll try - I did UI & OpenGL in a former life...
So - why Cairo. Well, Cairo *is* 2D-friendly - it's an API for drawing 2D stuff, like lines, polygons, that kind of thing. But there's "2D" and there's "2D".
"Old" 2D hardware did memory-interesting operations: moving blocks of memory around at high speed (often called 'sprites') for example is very common and very useful (a nice smooth mouse pointer). It may also do things like filling areas quickly (usually rectangles), and other assorted stuff. But, to call this "2D hardware" is really missing the point - it's acceleration of memory operations that happen to be useful for bitmaps.
Now, drawing complex lines and things is as much rasterisation as drawing 3D objects - in fact, it's basically the same problem, just with the Z-dimension removed.
Cairo is this 'high level 2D' API, which does things in a nicer, more abstract 'lines and curves' way, but this is a lot more graphics work than old cards are used to. If you think of 2D being a simplification of the 3D mathematics (which is basically is), you can think of 2D being less work than 3D, but still quite complex (the basic mixing of pixel colours where things overlap still happens, taking care of transparency, that kind of thing). That kind of view is completely different to the "memory buffers" view of older cards.
As an example, look at drawings in OpenOffice.org with Cairo turned on:
http://primates.ximian.com/~michael/ooo-cairo.png
You can see the polygons on the page have smooth edges. That's what Cairo does; it's a high-quality 2D library. It's also output-neutral: the Mozilla people have had trouble generating pages for printing since, well, years ago, and Cairo nicely solves part of the issue. And this is all in software, none of this requires 3D anything.
So, where does GL come in? High-quality 2D is a substantial amount of work, and it just so happens that OpenGL will happily do 2D operations for you. GL is a convenient way of speeding up Cairo drawing operations, by offloading the drawing to the graphics card. This is what this "Glitz" thing is - it's Cairo running on GL, and running pretty fast compared to the all-software version.
There are alternatives to GL, such as:
http://www.khronos.org/openvg/
(which is an interesting demonstration of the stuff you need to do for modern 2D displays in its own right). But, they're even less suitable.
Is everyone going GL because they are ignorant or just willing to ignore what looks like a new Java Trap problem to get the benefits?
Almost certainly the latter, although it's hard to see how you could get the benefits (and there are benefits) in any other way, so it's not quite the same.
The benefits aren't just eye-candy. I think we've all seen PDF files load in front of our eyes because there is so much stuff on the page; a GL-accelerated PDF reader would render it instantaneously. Being able to have a resolution-independent display (so that it can be smoothly zoomed, useful if you have poor eyesight) needs that acceleration. Being able to drive a high-resolution display would almost certainly need it, and being able to support real-time vector graphics (e.g., SVG icons, themes, etc.) across a whole desktop probably needs it.
What I'm trying to get across is that this isn't developers wanting to spin and rotate windows on three axes, there are lots of 2D reasons for wanting a GL-based desktop. It makes the display much higher quality, faster, and takes load off the main CPU which ends up doing much less drawing. People want to leave the world of bitmaps and memory shunting behind, and move to a wholly vector-art based system.
What is the scale of this problem? A few cards have been mentioned, but the messages make it sound like they're a small minority of 3d hardware on sale today. Are there similar sites to r300.sf.net for other manufacturers, or any overview site?
No, not really, it's a mess.
R300 and R200 (the two best drivers, I think) are for a limited range of older Radeon cards (basically, anything without an X at the start of the model number). I believe there are some drivers for an Intel chipset, and a few for some older cards. Nothing nVidia is available, and nothing modern ATI.
Basically, anything which supports "modern" 3D is not available in a free software driver. In terms of "modern" features, I'm talking about things like vertex shaders - small programs that software downloads onto the 3D card in order to make them do incredible things. This is how complex the interfaces with these cards has become.
Cheers,
Alex.