[Chimera-users] VRML alpha vs 1-alpha

Greg Couch gregc at cgl.ucsf.edu
Tue Jan 22 10:37:54 PST 2008


On Tue, 22 Jan 2008, Nils Becker wrote:

> Hi,
>
> I found information on the web site that VRML models use
> 1-alpha blending for transparency, and that that looks ugly.
> I agree.
>
> Now I have externally generated VRML files including transparency.
>
> Is there a way to get nice (normal) transparency rendering of these
> models in chimera?
>
> e.g. editing the vrml files, converting them to another format or some
> option inside chimera?
>
> Thanks for any help, cheers, Nils

The VRML transparency is 1-alpha, because alpha is an opacity value.  So 
that is just an alternative way of saying that same thing, and is not the 
reason it is worse.

The reason VRML transparency is worse is that there is no sorting within 
the VRML shapes, so the blending of transparent objects has to be 
drawing-order independent, so VRML uses additive blending.

The simpliest solution would be to live with chimera's current depiction 
and use the Save Image dialog to generate a ray-traced version.  The 
ray-traced version will be much nicer (and take a lot longer to compute, 
try using the POV-Ray 3.7 beta on a multi-core computer to speed things 
up).

The other solution, is to write some Python code and use the _surface 
module's Surface_Model and Surface_Group classes.  That is, convert each 
VRML object into a triangulated surface, a Surface_Group, and put all of 
the Surface_Groups into one Surface_Model.  All surfaces within one 
Surface_Model are sorted so that the transparency is correct for more than 
one overlapping surface (unlike the transpareny in chimera between 
models that only works for one level of transparency).  You can see 
examples that use the _surface module in the GraspSurface, IMOD, 
Icosahedron, and Intersurf modules (and others) in the CHIMERA/share 
directory of your installation.

If you have any questions about the _surface module, please ask them on 
the chimera developers mailing list, chimera-dev at cgl.ucsf.edu.

 	Greg Couch
 	UCSF Computer Graphics Lab



More information about the Chimera-users mailing list