From: John Stone (johns_at_ks.uiuc.edu)
Date: Fri Apr 19 2019 - 11:52:54 CDT

Hi Luc,
  There are a number of technical issues involved with molecular
scene export that impact the experiences you've described with
Wavefront OBJ in particular.

VMD handles transparency as a per-primitive texturing property rather
than a property of a collection of objects, which creates some challenges
for VMD. Since it assigns both the color and material together, VMD
ends up writing out a table of color-material combinations, which can
get pretty large. To avoid problems with the size of that table, VMD
currently hard-codes the transparency value as opaque.
For a linear increase in the number of table entries, I could change
the code to emit a much larger table with a more accurate per-VMD-material
table entry, but the scene file would have another few thousand material
entries per VMD-material. I'll have to see if this is viable or still
problematic for current-generation external tools that work with OBJ files.
When I originally wrote the OBJ export code, most tools had very limited
support for alpha-blended transparency, so the table size was a bigger
consideration than the visual outcome.

VMD renders electrostatic fields onto molecular geometry using
hardware 3-D texture mapping. Unfortunately there's not a good
way of describing this kind of 3D-texture-based surface coloring
in many of the old scene file formats, particularly OBJ, as
it dates back to the mid-1990s when 3-D texture mapping was a very
new technology that was not yet widely available in graphics hardware.

Best,
  John Stone
  vmd_at_ks.uiuc.edu

On Wed, Apr 17, 2019 at 10:41:52PM +0000, Luc Boisvert wrote:
> Hi all,
>
>
>
> Is there a way that a surface (for example, orbital or density map) can be
> obtained with some transparency and/or multiple colors when rendering as
> 3D Wavefront OBJ?
>
>
>
> I've been writing tutorials on how to create 3D molecules that can be
> manipulated in PowerPoint, taking advantage of PowerPoint's recent ability
> to use 3D objects (see here for a quick example:
> https://www.youtube.com/watch?v=-8gixfxJlcY).
>
>
>
> Whatever I try, when a surface is made to be transparent in VMD (under
> Graphics, Graphical Representations and choosing a transparent Material),
> it renders as opaque when rendered as OBJ. I then have to take the obj
> file into something like Blender to change the transparency of the mesh.
> Also, it seems like surfaces with multiple colors (such as electrostatic
> potential maps) render as one color only as OBJ. Is there a way to render
> as OBJ and keeping the different colors on the surface?
>
>
>
> Thank you in advance for any help.
>
>
>
> Luc
>
>
>
>

-- 
NIH Center 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/