Creating Real Time 3D Graphics With OpenGL

by Chris Halsall

You see a missile coming at you, fired by an opponent off on another platform. Its translucent smoke trail is more of a give-away than the rocket flame, which is mostly obscured by the missile as it hurls itself directly towards you. Dart to the right, off the ledge, while you rail-gun your opponent; his body comes apart into pieces, each bouncing around leaving bloody stains where they hit.

While not everyone may agree with the content of Quake3 Arena, or any of a multitude of other violent games available, it's hard not to be impressed with the technical sophistication of the images produced. Many, including Q3A, rely on the OpenGL Application Programming Interface (API) to do the actual rendering. OpenGL is a good choice for developers who want to produce real-time 3D images because it's cross platform and mature. OpenGL (or a clone) API is available on most modern desktops, with some taking advantage of 3D hardware acceleration provided by the video card.

A brief OpenGL history

Images from Q3A rely on the OpenGL API for rendering.

Figure 1. Images from Quake3 Arena rely on the OpenGL API for their rendering.

OpenGL was developed by SGI (split off from IrixGL when the company was still known as Silicon Graphics), and the OpenGL name is a registered trademark owned by the company. For many years, the only real access to OpenGL was by way of high-end Unix workstations, which were used for engineering, scientific, and visualization work. SGI's IRIX-based machines were generally considered to be the best, as they usually came with leading-edge, highly optimized 3D acceleration hardware. They also came with extremely high price tags.

For anyone who wanted to provide the OpenGL API itself (as opposed to just using the API as a client program), SGI licensed the use of the name, a set of conformance tests, and a Sample Implementation (SI) in software for $100,000, with binary redistribution rights available for an additional $5 per copy royalty. Having this license and passing the tests gave someone the right to claim to be truly OpenGL compliant.

Fast-forward a few years and bring mass-market consumer economics to bear, and 3D acceleration hardware which used to cost $50,000 is now available for $250. Oh, and it's faster. It seems people just can't get enough of shooting at each other, and those who have machines that can render high-resolution displays at high frame rates have a better chance of taking out their opponents.

Related Articles:

OpenGL Rendering and Drawing

Preparing to Build an OpenGL Application

Utah GLX

In order to still be considered open, and to help get their API used, SGI has always allowed the copying of the OpenGL header files in order to produce compatible "clones." Examples include all the various "MiniGL" versions available for different 3D hardware cards under Windows. These are often written solely with games in mind and may not work well with, for example, a CAD program.

Just recently, SGI has revised the access terms to their SI to be much more "open." Available for free download, the new license now allows hardware vendors who based their drivers on the SI to release their code in source form, if they so choose. This is great news for users and developers on Linux, and continues SGI's commitment to contributing technologies to the open source community. It's important to note, however, that SGI still owns, controls, and limits the use of the term OpenGL.

One clone implementation of particular interest to Linux/Free Unix users is the Mesa 3-D graphics library, written by Brian Paul and others at Mesa is a GPLed, OpenGL-like implementation which until recently was as close to "real" OpenGL as you can get (with source code) without paying money. And while SGI's SI does provide "complete feature coverage," including new imaging features defined in OpenGL 1.2, Mesa actually turns out to be a bit faster in some situations. SGI is quite supportive of Mesa, and has recently given Brian a copy of the conformance tests to use. Mesa is still not allowed to claim to be OpenGL, however.

Pages: 1, 2, 3

Next Pagearrow