Emerging standards, from a variety of sources, promise to simplify 3-D graphics development
John Foust
Standards are great, that's why everyone has one," goes the old joke. The history of computer graphics is littered with now-unused standards and out-dated acronyms from yesterday's technology.
Today, emerging standards for 3-D graphics hardware and software are leaving the relatively obscure realms of scientific visualization, engineering, and computer animation, and appearing in ordinary operating systems and applications. 3-D graphics standards include APIs that define standard sets of graphics functions for programmers to use and specialized hardware to accelerate those functions, as well as file formats to help pass data from one program to another.
What's different about the latest standards? T
hese technologies certainly affect the users of 3-D programs, but they're also working their way into everyday applications like spreadsheets, presentation graphics, and even your next operating system. (The World Wide Web is also becoming three-dimensional: see the sidebar "VRML and the 3-D Web".) The flow of technology is unusual, too. We've come to expect that new high-priced, high-power technology will eventually drop in price and become commonplace. While true for 3-D graphics, there's also an interesting flow from so-called "low-end" computer game technology up into common personal computers.
OpenGL
OpenGL is a graphics programming standard that began as a proprietary API but then evolved to become a cross-platform success. It started on Silicon Graphics workstations but is now part of OSes like Windows NT and OS/2. It is most popular in mechanical and architectural CAD, animation, and simulation because of its growing use on various workstations, and the extra speed that
specialized hardware delivers.
OpenGL includes more than 120 functions to draw 2-D and 3-D data to the screen. It supports polygon shading, texture mapping (coloring polygons with bit-map images), lighting, animation, atmospheric effects, depth cueing (dimming objects farther from the viewer), and fast rasterization (calculating the pixels that fill a polygon on the screen). Higher-level operations, such as CAD-like parts and predefined subobjects, are left to the application developer.
OpenGL uses an underlying client-server model for interpreting commands. This makes it possible (but not necessary) for client and server to be on different networked machines: For example, to use your hardware efficiently, the intense floating-point operations of a 3-D renderer could run on a more powerful computer, while the display appears on a lower-cost workstation. For greatest speed, eliminating any bottlenecks between client and server, all operations can run on a single computer.
OpenGL doesn't h
ave functions related to windowing, so it is not tied to other standards like X Windows or Microsoft Windows. Instead, vendors develop extension libraries for OpenGL for each user interface standard. For example, there is an OpenGL extension called GLX for X Window applications, and another for Tk, a popular user interface toolkit for X Window development. For Windows NT, Microsoft added a layer called wgl that connects OpenGL to the window programming interface of Windows NT. Like other windowing extension libraries, wgl helps connect OpenGL's drawing abilities to the usual programming interface for Windows NT.
OpenGL began in the early 80s as IRIS GL, which was a proprietary graphics programming interface for Silicon Graphics workstations. Years of graphics programmers working with some of the most advanced graphics hardware and software refined the character of IRIS (a type of Silicon Graphics computer) GL (graphics language). As IRIS GL became more popular and customers wanted to port their GL prog
rams to other platforms, Silicon Graphics opened the GL standard to other parties, giving rise to OpenGL.
Due to its open licensing, OpenGL is available for environments including Windows NT Workstation 3.5 and Win32s, OS/2, Sun Solaris, Apple MacOS for Power Macintosh, Digital Equipment OSF/1 AXP, and many others. There is even a freely distributable "clone," called Mesa, that offers some of OpenGL's functionality. OpenGL has been licensed to more than thirty vendors, including Microsoft, IBM, Digital, Sony, and Evans & Sutherland. Addison-Wesley publishes the most popular guides to OpenGL, the
OpenGL Reference Manual
and the
OpenGL Programming Guide
, also known as the "blue book" and the "red book," respectively.
OpenGL Hardware Acceleration
On workstations, OpenGL benefits from special-purpose hardware acceleration, without which it would be impossible to manipulate hundreds of thousands of lines and polygons. This hardware ranges in power, of course
, but also in price, from tens of thousands to millions of dollars. Now hardware graphics-acceleration technology is available in video cards for a few hundred dollars.
Hardware acceleration of simple graphics functions like line drawing and bit-map copying have been present in hardware cards for a few years, but now more sophisticated OpenGL functions are appearing in hardware, too, in cards from S3, STB, Creative Labs, and Intergraph.
For example, under Windows NT, there are three levels of support for OpenGL. The simplest is software emulation: all OpenGL functions are implemented in software (in a new DLL, like many other extensions to Windows NT), so any Windows NT computer can run OpenGL programs. Software emulation is slow, however. The second level of support is called hardware assist, in which an accelerated video driver makes an optimized connection to the software OpenGL functions. This technique is faster than pure software emulation, but not by very much. The speed increase in this
level of support is similar to the gains that any accelerated video card delivers. The final level is native mode, where one or more OpenGL functions correspond directly to hardware support.
The 3Dlabs GLINT chip is special-purpose hardware for accelerating OpenGL. (Other similar OpenGL-accelerating chips are available from Accel Graphics, ATI, Oki, and S-MOS.) The GLINT chip is unusual because it was designed with OpenGL in mind. Its hardware accelerates OpenGL's rasterization layer. It also includes antialiasing, texture mapping, smooth shading of polygonal regions, and clipping pixels against stencil masks. Simply stated, it answers such questions as "Which pixels are in this polygon?" "What color are they?" and "Are they visible on screen?"
A native mode driver in Windows NT supports the GLINT chip. OpenGL calls are routed directly to the GLINT chip. Normal GDI (Graphical Device Interface) graphics calls pass through GDI32.DLL and into the GLINT device driver interface. See the figure,
"Hardware Support for OpenGL."
Other companies are using GLINT to improve performance in their PC applications. 3Dlabs and Creative Labs are allied to develop a very low-cost version of the GLINT chip for multimedia cards. Intergraph Software Solutions created optimized software that links its MicroStation CAD product to OpenGL and GLINT chip hardware optimization. They claim a 3000 percent speed increase in some 3-D operations, and an overall 40 percent improvement in the time it takes to display average CAD drawings on a two-processor system.
Open Inventor
Silicon Graphics' Open Inventor is an object-oriented 3-D toolkit that rests upon OpenGL. A library of C++ objects and methods that provide higher-level abstractions beyond the simple drawing functions of OpenGL, Open Inventor makes it even easier to write 3-D applications and provides a higher-level interface above OpenGL, incorporating geometry and motion. Open Inventor's objects include geometric p
rimitives with attributes such as surface coloring and motions, manipulators for expressing methods (such as trackballs for moving objects), and premade components such as lighting and material editors.
The Inventor Component Library links to Xt Intrinics for Motif-style X Window programming. With this, a simple demo containing a shaded cone, light source and trackball manipulator takes less than thirty lines of C++ code (see the demo program
"3-D in 30 Lines"
). Open Inventor programs can even make direct calls to OpenGL rendering functions, through subclassing of Open Inventor objects.
Like OpenGL, Open Inventor has been licensed to other companies, including Template Graphics Software and Portable Graphics. These companies have ported Open Inventor to such platforms as the Sun SparcStation, the IBM RS/6000, and the Power Mac.
QuickDraw 3D
Early in 1995, Apple Computer introduced QuickDraw 3D, a 3-D graphics extension to the Mac OS. QuickDraw
3D is an API for developers, but it also defines a new file format standard. QuickDraw 3D will become part of the PowerPC-based Mac OS in late 1995. Apple promises cross-platform support, too, and intends to have a version for Microsoft Windows within six months.
Like OpenGL, QuickDraw 3D includes standard functions for 2-D and 3-D primitives. QuickDraw 3D goes far beyond OpenGL, though. It stores higher-level geometry, from 3-D points to polygons to NURBS (nonuniform rational B-spline) spline-based geometry, similar to Open Inventor. Plus, it is an extension of the Mac environment into three dimensions.
One primary goal is ease of use: 3-D programs are notorious for complex user interfaces often radically different from each other. Apple plans standards for 3-D user interfaces, such as bounding boxes that surround objects and methods of selecting and scaling objects, so that the same keystrokes and mouse movements will produce the same results even in different programs.
For example,
the screen shows
a sphere and a cube floating above a checkered floor. Both objects have shadows to help show position and height above the floor. Without these visual clues, it might be difficult to determine which object was closer to the viewer. The cube is selected, highlighted by a bounding box, and rotated slightly: its shadow changes shape, too. This 3-D view is generated by QuickDraw 3D's interactive renderer, so developers no longer need to spend time writing fast rendering code.
Because the makers of Macintosh-based 3-D programs have found it quite easy to integrate QuickDraw 3D, expect to see some aspect in all 3-D programs. Apple claims QuickDraw 3D support was added to one popular 3-D program in less than two hours.
QuickDraw 3D also defines a new file format, known as the QuickDraw 3D metafile. For the user, the metafile means easy clipboard cut-and-paste of 3-D graphics between applications, and a new standard for exchanging models between 3-D programs, elimin
ating the need for cumbersome and inaccurate conversions involving DXF or IGES files.
QuickDraw 3D is a very open architecture. Almost every API component is extensible. Once installed, all QuickDraw 3D-aware applications can use the new extensions. Similarly, QuickDraw 3D fits into future developments such as OpenDoc, Apple's plan for a compound document architecture. Clicking on a 3-D graphic might invoke a 3-D modeler in the form of an OpenDoc part editor.
QuickDraw 3D does not exclude the use of OpenGL as a graphics API (see the figure
"A QuickDraw 3D Model"
). Since QuickDraw 3D encompasses far more technology than simple cross-platform drawing commands, it is easy to subsume the functions of OpenGL.
For example, Template Graphics makes an OpenGL library for the Apple Power Macintosh with special extensions. They created AGL (Apple graphics library), an extension that links the OpenGL graphics calls to the Mac's windowing system, similar to the wgl library in Mi
crosoft's implementation of OpenGL. AGL makes it easier for an OpenGL application to read and write the QuickDraw 3D metafile, or to write cooperative applications that exploit both OpenGL and QuickDraw 3D.
Hardware companies also plan accelerators for QuickDraw 3D. YARC Systems Corp. has announced a board called Screamer that couples a RISC processor with a 3Dlabs GLINT chip. Through the proper device drivers, any hardware graphics accelerator (like GLINT) can provide its services to both QuickDraw 3D and OpenGL.
Rapid Renderers
In the past two years, three products delivered rapid rendering technology suitable for personal computers. These products are RenderMorphics' Reality Lab, Canon Criterion's RenderWare, and Argonaut Technologies' BRender. With the greater power of today's 486 and Pentium computers, it became possible to render animated 3-D models composed of thousands of polygons at nearly real-time speeds, as fast as 30 frames per second (
see t
he screen of RenderWare's animated knights
).
Surprisingly, the popularity of rapid rendering technology is moving from the alleged "low end" of the computer market, where it was used for game technology, into the mainstream where it becomes part of the basic operating system. This market took a step forward when Microsoft purchased RenderMorphics in early 1995 and announced plans to fold its renderer into new versions of Microsoft Windows. It is positioned to complement the high-precision rendering of OpenGL in Windows NT. The RenderMorphics API is being promoted as a standard for programming games as well as more mundane applications. But not all users of rapid rendering technology are making games. The advance of multimedia means a programmer is more likely to need rapid rendering of 3-D charts and graphs in a spreadsheet or presentation graphics program.
How do these packages achieve their speed? According to Argonaut's managing director Jez San, "BRender is significantly faster than Open
GL because it is an immediate-mode renderer. BRender's math and rendering routines operate on polygons in bulk using tight loops, avoiding the context-switching and thrashing of the cache you might see in OpenGL because of one-by-one polygon processing." Also, BRender uses either fixed-point math or floating-point math, depending on which is the fastest method for the processor. On Intel processors, fixed-point has the advantage, while the PowerPC version benefits from floating-point math.
Plug-In
Another extensible technology is bringing dramatic changes to photo-realistic 3-D rendering packages such as Autodesk 3D Studio, NewTek LightWave 3D, Strata Studio and the Electric Image Animation System. Each of these 3-D programs has defined a "plug-in" standard. Plug-ins are a way for third-party programmers to extend and customize the interface and abilities of the 3-D program. For example, 3D Studio plug-ins create geometry like fractal plants, add the effect of a lens flare or f
ireworks to an animation, alter the texture of objects, and calculate kinetic effects like accurately bouncing balls and collision detection.
Plug-ins give a marketing advantage, too. Although 18 months may pass between major releases of a 3-D program, plug-ins can be released at any time. Outside developers can make plug-in tools as well as the company that makes the 3-D program can. The release of a new plug-in teaches an old program new tricks. These "standards" are proprietary to each 3-D program, but many companies utilize them. In this case, there's a good excuse for each company creating its own standard for plug-ins.
Speed is the essence of this concept. 3-D rendering programs must be very fast, and any extensions to the rendering process must be very fast, too. Plug-ins therefore require a tight coupling between the main program and the plug-in. Program execution may jump from the main 3-D program into the plug-in many thousands of times per rendering. For example, a plug-in might provi
de an algorithmically generated "orange peel" texture. For each pixel assigned the orange peel texture, the main 3-D application will shift program control to the plug-in to let it calculate the exact pixel color to maintain the orange peel appearance.
Wise Ending
In theory, standards exist to make life easier for everyone who uses a computer: hardware developers, programmers, and users. The changing nature of computer applications--including beveled and shaded buttons, increasingly complex multimedia displays, virtual reality interfaces, and other three-dimensional features--requires the firm foundation of fast and capable graphics standards. These standards must not only support existing uses, but anticipate new possibilities to come in the next few years: a tall order to fill for any technology, but especially for one we look at every day. Standards can be frustrating when they hinder rather than help. The future is bright: OpenGL, VRML, QuickDraw 3D and 3-D plug-ins will ce
rtainly enhance the applications you use today, as well as those you'll use tomorrow.
WHERE TO FIND
OpenGL Reference Manual
, ISBN 0-201-63276-4
OpenGL Programming Guide
, ISBN 0-201-63274-8
Addison Wesley Publishing Company
AGL
Open Inventor
WebSpace
Template Graphics Software
San Diego, CA
(619) 457-5359
fax: (619) 452-2547
[email protected]
http://www.sd.tgs.com/template/
BRender
Argonaut Technologies Ltd.
London, U.K.
+44 181 358-2993
fax: +44 181 358-2920
GLINT
3Dlabs, Inc.
San Jose, CA
(408) 436-3455
fax: (408) 436-3458
[email protected]
Open Inventor
Portable Graphics, Inc.
One Technology Center
Austin, TX
(512) 719-8000
fax: (512) 832-0752
[email protected]
OpenGL and Open Inventor
Silicon Graphics Computer Systems
Mountain View, CA
(415) 960-1980
http://www.sgi.com/t
ech/openGL/opengl.html
http://www.sgi.com/tech/Inventor.html
Reality Lab
Microsoft
Redmond, WA
(206) 882-8080
fax: (206) 936-7329
RenderWare
Canon Criterion Software, Ltd.
Guildford, U.K.
+44 483 448800
fax: +44 483 448811
This is a simple demo program illustrating how a complete,
illuminated 3-D scene with a trackball manipulator can be
implemented in less than 30 lines of C++ using Open Inventor.
main( int, char **argv )
{
// Init Inventor and Xt
Widget myWindow = SoXt::init(argv[0]);
if (myWindow = NULL) exit(1);
// Make a scene containing a red cone
SoSeparator *root = new SoSeparator;
root->ref();
SoPerspectiveCamera *myCamera = new SoPerspectiveCamera;
root->addChild(myCamera);
root->addChild(new SoDirectionalLight);
root->addChild(new SoTrackballManip);
SoMaterial *myMaterial =
new SoMaterial;
myMaterial->diffuseColor.setValue(1.0, 0.0, 0.0); // red
root->addChild(myMaterial);
root->addChild(new SoCone);
// Add a render area to the window
SoXtRenderArea *myRenderArea = new SoXtRenderArea(myWindow);
// View everything in scene
myCamera->viewAll( root, myRenderArea->getViewpointRegion() );
// Put scene to render area, set title
myRenderArea->setSceneGraph(root);
myRenderArea->setTitle("Hello Cone");
myRenderArea->show();
SoXt::show(myWindow);
SoXt::mainLoop();
}
illustration_link (49 Kbytes)

A combination of drivers, DLLs, and the GLINT chip provide hardware acceleration for OpenGL.
illustration_link (130 Kbytes)

QuickDraw 3D's architecture supports a variety of standards.
screen_link (51 Kbytes)

Editing a QuickDraw 3D scene in Apple's interactive renderer.
screen_link (65 Kbytes)

This demonstration program shows two animated knights rendered with smoothing and texture maps, in a scene complete with castle and cloudy sky, rendered in real-time using Canon Criterion's RenderWare.
John Foust is president of Syndesis Corp. (Jefferson, WI), makers of InterChange, a program that translates between more than 30 3-D file formats. You can reach him on the Internet or BIX c/o
[email protected]
.