From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Sep 29 2004 - 09:55:59 CDT

Konrad,

On Wed, Sep 29, 2004 at 10:45:18AM +0200, hinsen_at_llb.saclay.cea.fr wrote:
> On 28.09.2004, at 19:31, John Stone wrote:
> > We removed the particular RGB-color commands used in the past in
> >favor of consistency with the rest of VMD, using the indexed color
> >scales.
>
> Consistency is fine, but at the price of removing features...

Well, I should probably explain more but I didn't think it would
interest you when I first replied. :)

Basically, by eliminating that feature, we could
completely rewrite the low-level graphics code in VMD, eliminating
several things that were responsible for lowering the graphics performance
substantially. In the process of doing this, we eliminated all of the
code that used RGB triplets rather than indexed colors. The only code
that remained that had been exposed as a feature to the user's was the
"draw color r g b", and so I decided that unless we found significant
scripts that used this feature, it would be deleted. Thus far only two
people (you're the second) have noticed in the last several years since
the change was made, so it seems to have been a reasonable decision.
In the intervening years, all of the users of the current versions of
the program have benefited from the various performance improvements that
were the direct result of these changes.

We do make test versions of VMD available so that people can try them
out before they are finalized. Since nobody complained back in 2001
when that change was made, we've long-since moved on and forgotten about it.

> >If you want to assign specific colors, this can still be done by
> >modifying
> >the color scale via a script and assigning the appropriate color index.
>
> The problem with that is that there is a fixed and small number of
> colors available. It is not uncommon in my applications to have
> hundreds of different colors (e.g. placing arrows on a grid covering a
> protein, with the color of the arrow indicating the value of some
> property).

The VMD color scale has 1024 entries, so it should be relatively easy
to map your colors within that range.

> Moreover, the indexed colors are global. If I generate two scripts that
> use colors, I can't load both without the second destroying the colors
> of the first.

True, but a better way to do it is to only add colors which are "different
enough" to justify having their own index, rather than blindly adding them
all. This is one of the reasons we chose to eliminate the user-accessible
methods for directly altering RGB colors. If you like, I can provide
you with an example of how to do this type of thing.

By minimizing various OpenGL state changes, VMD can render various
things significantly faster than was possible when unindexed RGB colors
were allowed to be used. This also allowed us to make several of the
external renderer modules produce more efficient scenes, and reduce
rendering times. This is definitely a trade-off between
flexibility and speed. Since our users tend to work with very large
molecular structures, we chose to enhance the speed, for better or for worse.

If you can show me the types of things you've been using the RGB
colors for, I can help you solve your problems or come up with an
another solution for this for the next version of the program.

  John

-- 
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