From: John Stone (johns_at_ks.uiuc.edu)
Date: Mon Jun 16 2003 - 10:11:33 CDT

Dear Daniel,
  I have a few answers to your questions regarding antialiasing etc.

1) Mac stuff
  The MacOS X version of VMD is written slightly differently from the Windows
and Unix versions presently. Both the Windows and Unix versions use
hand-written OpenGL windowing code that I developed which allow them to
access features such as stereoscopic rendering, multisample antialiasing,
video pixel readback, etc. The MacOS X version of VMD currently uses the
FLTK GUI toolkit to render its OpenGL window, as a result, the only
extensions available in MacOS X are those OpenGL extensions that can be
queried/enabled well after the OpenGL window is initially created.

At present, FLTK doesn't know how to enable stereo on MacOS X, so this
prevents us from using quad-buffered stereo on the Mac, however Apple doesn't
yet support full quad-buffered stereo on any of the video cards currently
available, so this is currently only a minor disadvantage. I haven't
decided whether it would be best for me to contribute a pile of MacOS X
patches to the FLTK developers, or if it would be best for me just to
implement my own hand-written "AquaOpenGLDisplayDevice.C" code to replace
FLTK in managing the VMD OpenGL window. Up to this point, it hasn't
mattered much, but soon MacOS X will support many more OpenGL features
that we will want to use, so I will probably start working on one or the
other solution soon after MacOS 10.3 becomes available.

Regarding the specific extensions you're having listed on your machine:
  Its not at all surprising to me that your list of OpenGL extensions is
fairly short. This is also true even on my ATI Radeon 9700-equipped test
box here in the lab. Apple doesn't yet support 100% of all OpenGL extensions,
and even if they did, they are constrained by the fact that they use a
significant amount of video memory for rendering of various Aqua GUI effects,
so even if they implemented all of them, its possible they would not enable
them on any but video cards with a significant amount of available memory.
By the way, the antialiasing used by Aqua is fairly different from
what is done in OpenGL for 3-D geometry, I believe Aqua's font antialiasing
code is all done on the host machine, and is not done on the GPU.

2) Linux stuff:
  I've seen the exact behavior you describe on NVidia cards as well.
Typically the cause is that beyond a certain window size, the graphics
board begins to take a serious performance hit because it runs out of
video memory and starts shuffling pages back and forth between the host
machine's memory and the on-board graphics memory, or similar operations
within its on-board memory system. Since you didn't mention what video
resolution you're running at I can't do the math, but you should consider
that if the OpenGL features are available, VMD's OpenGL window will use:
Xres * Yres *
  (
   ((4 bytes per pixel OpenGL color buffer) * (2 for mono, 4 for stereo)) +
   (1 or more bytes per pixel OpenGL stencil buffer) +
   (up to N more bytes per pixel for multisample antialiasing with N samples)
  )

So, for a 1280x1024 window with quad-buffered stereo enabled, stencil buffer
and we'll say 4 samples per pixel antialiasing, you're already looking at
burning 32MB of video memory just for the VMD window, not counting any
of the other windows you've got on the display!!

And that's a pretty conservative estimate that does not include things
like cached OpenGL display lists, cached vertex arrays, etc. By the time
you add it all up, its quite easy for VMD to annihilate a 64MB video card,
particularly if you have anything besides VMD running, or if the X server
keeps a copy of the rest of the screen in the back buffer for fast
X redraws....

In our last round of hardware upgrades here in our lab, we bought 128MB video
boards for all of the Linux PC's specifically to address performance problems
when running at high resolution. As you can imagine, this issue is even more
severe if you're running your PC with dual monitors!!!! :-)

Several of our Sun workstations are setup with video boards that have
384MB of video memory, so they can do quad-buffered stereo, stencil buffering,
and multisample antialiasing with between 4 and 16 samples per pixel,
and they still have plenty of video memory for things like volumetric data,
(electron density map data -> volume slice rep in VMD), etc.

If in doubt, get a video board with a lot of video memory, it will prevent
your performance from dropping to zilch with large windows. The only other
option is to disable features in VMD, which we'd rather not do since we
try to be very forward looking and agressive in our use of OpenGL features.

Thanks,
  John Stone

On Mon, Jun 16, 2003 at 12:45:54PM +0300, Dr. Daniel James White PhD wrote:
> Hi all,
>
> 1)
> i just wondered if antialiasing is going supported in the OSX VMD1.8.1
> Since the aqua interface does lots of antialiasing, the OSX is well
> surely well geared for it,
> and It would look soooo nice on my flat panel LCD iMac with the NVIDIA
> GeForce2 MX.
> Shame that the nice new ribbons don't have nice edges....
>
> should there be more open GL extensions available than the ones listed
> in my VMD startup below?
> Am I doing something wrong.
> BTW the native interface looks super! Nice anti aliased menus etc.
>
> 2)
> On my linux machine (ATI RADEON 8500 64 Mb, athalon 2 GHz, RedHat 8.0,
> Xig summit2.2 Xserver)
> I see the rendering performance (fps) drops drastically after the
> openGL window is made larger than a certain size.
> This does not happen with the OSX version, or with pymol or Bodil on
> the linux machine.
> Is this something to do with the video memory getting filled up and VMD
> having to use virtual memory?
> and if so why does it not happen with the other software such as pymol
>
> Do I just need to tweak my settings?
>
> cheers
>
> Dan
>
> [daniel:~] dan% /Applications/VMD/VMD\
> 1.8.1.app/Contents/MacOS/VMD.startup; exit
> Info) VMD for MACOSX, version 1.8.1 (June 15, 2003)
> Info) http://www.ks.uiuc.edu/Research/vmd/
> Info) Email questions and bug reports to vmd_at_ks.uiuc.edu
> Info) Please include this reference in published work using VMD:
> Info) Humphrey, W., Dalke, A. and Schulten, K., `VMD - Visual
> Info) Molecular Dynamics', J. Molec. Graphics 1996, 14.1, 33-38.
> Info) -------------------------------------------------------------
> Info) Multithreading available, 1 CPU detected.
> Info) OpenGL renderer: NVIDIA GeForce2 MX OpenGL Engine
> Info) Features: STENCIL RN
> Info) Textures: 2-D (2048x2048)
>
>
> Dr. Daniel James White BSc. (Hons.) PhD
> Cell Biology
> Department of biological and environmental science
> PO Box 35
> University of Jyväskylä
> Jyväskylä FIN 40014
> Finland
> +358 (0)14 260 4183 (work)
> +358 (0)414740463 (mob)
>
> http://www.chalkie.org.uk
> dan_at_chalkie.org.uk
> white_at_cc.jyu.fi

-- 
NIH Resource for Macromolecular Modeling and Bioinformatics
Beckman Institute for Advanced Science and Technology
University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
Email: johns_at_ks.uiuc.edu                 Phone: 217-244-3349              
  WWW: http://www.ks.uiuc.edu/~johns/      Fax: 217-244-6078