Tachyon version 0.98 (included with VMD 1.8.6) has been updated to provide VMD with the ability to display molecules with ambient occlusion lighting. This lighting technique mimicks some of the effects that occur under conditions of omnidirectional diffuse illumination, e.g. outdoors on an overcast day. This lighting used in concert with traditional point source lights and directional lights to increase the perception of shape, depth in images of molecular structures, and decreases the deleterious effects of harsh shadows which otherwise occur with lighting based on a small number of point sources. This lighting model is particularly good at emulating the appearance of chalky materials, and can make molecular graphics more understandable, not to mention aesthetically appealing.

Ambient Occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon Ambient occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon Ambient Occlusion test image created with VMD and Tachyon

The ambient occlusion lighting feature of Tachyon has been designed so that existing Tachyon scene files (e.g. produced by older versions of VMD) can be re-rendered using the new lighting mode without the need to re-export or edit the scene file to enable the new lighting mode. The new lighting mode can be enabled through new command line options when running Tachyon. Since the ambient occlusion lighting mode involves performing a small monte carlo sampling of illumination at every visible point in the scene, rendering with ambient occlusion lighting takes longer than without it. In some cases it may take three times as long, as a result of the significant amount of additional sampling that takes place.

At present, VMD doesn't contain specific material properties or rendering controls to directly manipulate the ambient occlusion lighting effect from within the program, as we are still evaluating the best method for incorporating this type of shading into the interactive VMD display. It will ultimately be possible to interactively view static molecular structures with this type of lighting within VMD, but until the necessary rendering architecture changes have been made, the best way to achieve this effect is through the use of Tachyon, which is the testbed implementation for the feature (writing AO shaders for a ray tracer is far simpler than adding them to the interactive OpenGL display).

The basic process for rendering a VMD scene in Tachyon using ambient occlusion lighting is as follows:

  1. Load molecular scene into VMD.
  2. Display the structure with your favorite representation.
  3. For each representation, select a material that's fairly diffuse (such as the "Diffuse" material provided in recent versions of VMD)
  4. Render the scene using File->Render->Tachyon, or use the "render" command to export the scene to a Tachyon .dat file.
  5. Once exported, you can re-render the scene using special Tachyon flags which override the lighting specified in the VMD scene with your own coefficients, allowing you to add in an ambient occlusion ("skylight") lighting factor.
  6. Note: for VMD scenes generated by versions older than VMD 1.8.6, an extra Tachyon command line flag, -normalfixup guess, must be added to the command line since the Tachyon 0.98 uses a new shading algorithm with much stricter requirements on polygon winding order.
  7. Tachyon can automatically rescale the intensity of point lights spotlights and directional lights in the scene when adding a "skylight" ambient occlusion contribution. This is done with the "-auto_skylight X" command where "X" is replaced by an intensity factor ranging from 0.0 to 1.0.
  8. In cases where the automatic scaling produces results which are too dark in areas where the ambient lighting doesn't reach, it is often desirable to take complete control over the scaling factor applied to the existing lights, for final adjustments. This is accmplished by manually specifying both the rescaled lighting and additional skylight components yourself, using the "-rescale_lights X -add_skylight Y" flags which also take intensity scaling factors from 0.0 to 1.0.
  9. The following example commands are good starting points for rendering images with ambient occlusion:
  10. tachyon -auto_skylight 0.8 inputscene.dat -o outputimage.tga
  11. tachyon -rescale_lights 0.2 -add_skylight 0.8 inputscene.dat -o outputimage.tga
  12. tachyon -rescale_lights 0.4 -add_skylight 0.7 inputscene.dat -o outputimage.tga -aasamples 8 (This version adds 8 antialiasing samples per pixel, for much smoother edges, but takes 8 times longer to run!)
  13. Due to the increased computational complexity of rendering with ambient occlusion lighting, it's highly recommended to run Tachyon on a multiprocessor or multi-core workstation for best performance.
  14. Besides running on a fast machine, another convenient way to run test renders over and over is to use the "-res xxxx yyyy" flag to override the scene-defined resolution of the rendered image. Using this flag you can render a small 256x256 or 512x512 test image, and when you've adjusted the lighting the way you like, you can render it at poster resolution and go out for lunch, with a command like:
  15. tachyon -res 2048 2048 -rescale_lights 0.4 -add_skylight 0.7 inputscene.dat -o outputimage.tga -aasamples 8
footer