OpenGL Benchmarking

If you're interested in benchmarking OpenGL performance, and do software development, check out http://www.specbench.org/gpc/opc/, the OpenGL Performance Characterization Project. They supply a benchmark program, and also host results of runs on a number of different platforms. Prior to finding out about this, we wrote our own benchmark program, and have the source and some results here. Should we use display lists, or not? Triangle strips or independent triangles? Inquiring minds want to know!

Our benchmark program is pieced together, using parts from Mark Kilgard's dinoshade program, and Brian Paul's isosurf program. The source code and an example input file are given below, as are the results of running the program under Linux on a Pentium133, using Mesa with 3Dfx acceleration (full screen), and through X11. If people email benchmark results for other machines, I'll post them here.

Source Code and input files

Benchmark Results

To run the benchmark, compile the source, start it up, and type 'b' in the window. You'll want to redirect output to a file. The benchmark runs through 500 different cases, doing 10 frames on each case. Rendered objects include the dino from Mark Kilgard's code, and some sort of triangle mesh object from Brian Paul's demos in the Mesa distribution. Things are rendered with a variety of different lightings, with and without shadows, with and without reflections, with and without polygon offsets, texture mapping, smooth and flat shading, display lists, non display lists, individual triangles, and triangle strips. Yes, 500 different cases (although not all of them are interesting). Without hardware acceleration, it takes a *long* time.

A couple of interesting things so far, and our results seem to match those of the OPC benchmark on high-end hardware.

  • Display lists give only a slight improvement over immediate mode (and in some cases, lists are slower). If your models are built from polygons that are pre-determined, you might as well just send them to the screen, rather than doing a display list. If the polygons have to be computed (for example, if you use one of the gluSphere type functions), then a display list will avoid repeated trig calculations. It might be argued that at some point, more functions will be supported in hardware, and display lists will be a big win. At present, however, they only have a slight advantage.
  • Triangle strips are roughly twice as fast as individual triangles when hardware acceleration is used. If the rendering is done in software, strips and individual triangles are similar in performance.
  • Hardware acceleration is a very good thing. The 3Dfx card can be around 60 times as fast as the software-only version. This shouldn't surprise anyone.

Chromatek 3D

If you're an OpenGL programmer, you might want to grab the file chroma.c, which is the source code for a VERY simple example program to do color-to-depth shading that makes the Chromatek glasses work. The color curves are not right, and it's not very fast, but it's kind of fun.

We'll be cleaning up the color curves, making it faster, and adding in support to AXIS.


... Cyberspace: A consensual hallucination experienced daily by billions of legitmate operators, in every nation....
William Gibson