From: Tim Freeman (tim_at_infoscreen.com)
Date: Sun Jul 16 2000 - 12:05:02 CDT

>From John Stone <johns_at_ks.uiuc.edu>:
> My own suggestion for getting the most bang for the buck with running
>VMD on a Linux box is to get one of the GeForce 256, or GeForce 2 GTS boards.
>We have had some great results with ours so far, and VMD (unlike most games)
>is extremely well suited to taking advantage of the hardware T&L on the
>GeForce boards. The hardware T&L gives the GeForce a big advantage over
>the other boards we've tried so far. The Voodoo boards are probably
>the next best choice, although they lack hardware T&L, and would be much
>more dependant on main CPU speed. I have no experience with the "xig"
>software you mention below, but we have been using XFree 4.0 with
>success, and intend to keep using that on the Linux boxes that some of
>our group's scientists use.

Are you using OpenGL? If so, how do you render spheres?

There are two ways I know of to render a sphere in OpenGL: either draw
a bunch of polygons (probably by calling gluSphere, maybe with the
optimization of using display lists), or create a depth buffer for the
sphere and render it with a primitive that renders a depth buffer
(specifically glDrawPixels with the format GL_DEPTH_COMPONENT, making
sure that the background pixels in the texture are transparent).

When developing Fungimol I tried both. If you draw, say, 20 polygons
per sphere, then you've instantly reduced your graphics performance by
a factor of 20. The OpenGL driver I had did not correctly implement
glDrawPixels with GL_DEPTH_COMPONENT, so drawing one depth buffer per
sphere was not an option for me either. The OpenGL driver I was using
was with XFree 3.something and it was available from NVIDIA as
RIVA-X-GLX-1.0-glibc-i386-dyn.tar.gz. Their versioning scheme for
XFree 4.whatever is completely different and incomparable. I haven't
tried Nvidia's latest driver yet.

So now, even though I have a functioning RIVA TNT2 3D graphics card
and a mostly-functioning OpenGL driver, Fungimol does software
rendering of spheres because that was the best performance I could
get. To ensure that all views of all instances of an atom are exactly
the same, Fungimol doesn't use perspective. The size of the image of
the atom is the same regardless of the depth.

Software rendering also allowed me to do a trick that I couldn't do
with hardware. Specifically, I render from front to back and maintain
a summary of the depth buffer. The summary is structured so that in
many cases if a figure (such as a sphere for an atom) is completely
obscured by stuff in front of it, I can efficiently determine this and
avoid drawing the figure altogether. This is good for nanotech
designs and space-filling atoms, since for these figures most of the
atoms are often hidden and therefore need not be drawn. On a 600 Mhz
Pentium III, Fungimol can draw Drexler's differential gear (which has
8297 atoms) full-screen in 166 milliseconds. Rasmol takes
more like 500 milliseconds. This is with C++ code that ought to be
portable; I haven't tried using MMX instructions yet. At the time I
abandonded my OpenGL implementation, Rasmol was at least 10 times
faster than my OpenGL implementation.

The code for Fungimol is LGPL'd and located at
http://www.infoscreen.com/fungimol.

-- 
Tim Freeman       
tim_at_infoscreen.com