From: John Stone (johns_at_ks.uiuc.edu)
Date: Wed Feb 01 2012 - 16:11:07 CST

Toni,
  I think you would be better off compute the distance value internal
to the shader on-the-fly. You could do this using distance from the the
particle position to the current fragment that's being rendered in GLSL.
For the sort of effect he's asking for, I think just modulating the
transparency and color by the distance from the particle position would
do a lot for you, and you can do that without any texture. I think
one could hack either the VMD sphere or point-sphere shaders to do something
like this without too much difficulty. I can look into it after VMD 1.9.1
is released.

Cheers,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Feb 01, 2012 at 10:56:52PM +0100, Toni Giorgino wrote:
> Dear John,
>
> do you think that it would be possible to expose a texture with the
> distance map to the GLSL shaders? That would allow truly amazing shader
> effects.
>
> It's done routinely in games and so, but requires some tricky (for me)
> opengl framebuffer setup.
>
> Thanks
>
> Toni
>
> On Wed, Feb 1, 2012 at 5:50 PM, John Stone <johns_at_ks.uiuc.edu> wrote:
>
> Hi,
> With custom-written shading code, you could achieve a density blob
> sort of effect similar to what you describe. Another possibility would
> be to synthesize a density map from the atoms, and use a volume renderer
> to render the density map with either an intensity projection or ray
> marching
> type approach. I plan to put some new volume rendering code in VMD
> sometime after the VMD 1.9.1 release that's about to come out.
> If you wanted to try your hand at hacking a GLSL shader, the VMD can
> be made to load your own custom shaders from disk files at startup time.
> You could override the behavior of the angle-modulated transparency of
> edge cueing features to do something else, that might get you started
> quickly.
>
> Cheers,
> John Stone
> vmd_at_ks.uiuc.edu
>
> On Wed, Feb 01, 2012 at 03:54:01PM -0000, Ben Hall wrote:
> > I was interested in rendering a few unusual datasets and wondered if
> (and
> > how) anyone has created images:
> >
> > * Where points are rendered as spheres of fog similar to the image
> linked
> > below. Here I used transparent spheres which roughly created the
> effect of
> > an even fog, but doesn't give appropriate increase in density at the
> > centre of each sphere
> >
> >
> http://sbcb.bioch.ox.ac.uk/users/hall/Site/Visualisation_Gallery.html#1
> >
> > (I imagine that the effect would look like the opposite of the new
> angle
> > modulated transparency for spheres)
> >
> > * Where the material appears radiant (ie to create a glowing drug in a
> > binding site)?
> >
> > Thanks
> >
> > Ben
> >
> >
> > --
> > Dr Benjamin A Hall
> > Centre for Computational Science, Department of Chemistry, UCL
> > benjamin.a.hall_at_ucl.ac.uk
> >
>
> --
> NIH Resource for Macromolecular Modeling and Bioinformatics
> Beckman Institute for Advanced Science and Technology
> University of Illinois, 405 N. Mathews Ave, Urbana, IL 61801
> http://www.ks.uiuc.edu/~johns/ Phone: 217-244-3349
> http://www.ks.uiuc.edu/Research/vmd/ Fax: 217-244-6078
>
> --
> Toni Giorgino, PhD - toni.giorgino_at_gmail.com - fax +39 0382 1850209
> Universitat Pompeu Fabra - Barcelona Biomedical Research Park (PRBB)
> Research fellow - Computational Biochemistry and Biophysics Lab
> C/ Doctor Aiguader 88, 08003 Barcelona, Spain

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