From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Sep 29 2004 - 13:05:16 CDT

Konrad,

On Wed, Sep 29, 2004 at 06:57:34PM +0200, hinsen_at_llb.saclay.cea.fr wrote:
> On 29.09.2004, at 16:55, John Stone wrote:
>
> >The VMD color scale has 1024 entries, so it should be relatively easy
> >to map your colors within that range.
>
> Ahhh... The manual says 49. That makes a lot of a difference.

Hmm, looks like I missed one spot when we updated the color scale
size. But, that's why it's implemented with a command rather than
being a documented constant. A properly written script can query
these numbers and use the right number of color table entries for
all versions of VMD. I've just fixed that spot in the documentation.

> How does VMD use the 1024 entries internally? I suppose the first 17
> correspond to the 17 named colors. But there must be others that are
> used for color scales.

VMD uses the 17 main colors for non gradient coloring schemes, and
uses the next 1024 for gradient color schemes. At present, the main
issue with this scheme is that there's only a single color scale
used for the whole program, but I plan to rewrite this code such
that there are an unlimited number of color scales, making it much
easier to make certain complex figures that involve multiple gradients,
while retaining the performance and efficiency advantages gained by
using indexed color tables.

We've haven't needed color tables larger than 1024 entries for normal
structural representations thus far, since a lot of the color gamut
is consumed by the results of further shading operations on the
basic 1024 colors. Down the road when OpenGL programmable shading
is more mature, we should be able to make further efficiency improvements
beyond what has been done already by writing special shading code to
more of the color table lookups in the shaders and less in VMD itself.
But, that's a topic for another day. :)

  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