# High quality molecular renderings

I would like to use a high-quality renderer (physically based path-tracing or MLT) to generate some images of molecular systems I have. Right now I'm just using some of the simple renderers in VMD, but I am curious if anyone has developed a plugin for something like Indigo Renderer or Luxrender?

Essentially it would convert an XYZ/CIF/PDB file into an input file for one of these programs, generating appropriate shapes and BRDF's for each type of atom.

I could write some code myself but I'd rather not reinvent the wheel, so if anyone knows of something out there, that'd be great! Thanks

• I've traditionally used PovChem for the purpose, but there might be nicer packages out there... Jun 19, 2013 at 3:06
• pymol does a pretty good job and can easily be scripted with python. it also allows export of scenes for professional rendering programs. the latter is also possible for vmd.
– Bort
Jun 21, 2013 at 15:08
• molscript/povscript can be used to generate povray input. It does pretty good job, though it is tricky to use. Aug 4, 2013 at 22:24

Thanks Nick, for the excellent instructions! I had been beating my head against the wall for awhile trying to get .pdbs into Blender (I'm haven't had much luck with some of the .pdb importers, such as ePMV (they feel sluggish and buggy on my mid-2013 MacBook Pro).

However, I did want to mention of couple of things that I thought might be helpful to anyone who runs across this post (by now, you probably already know this, I certainly didn't when I started!):

1) When exporting the Wavefront object, I have found that I need the ribbons (New Cartoon) to have a resolution of at least 25 and licorice should be higher still. Otherwise, when you import into Blender, it won't look smooth. However, don't crank it up crazy high (like 50+), or your object/mtl files will be insanely huge (2-30 Gb--unmanageable!). Still trying to find just the right balance. :)

2) Once imported, make sure you remove duplicate vertices (select object, click "Tab" to go into edit mode, and under "Tools" (on the left) click "Remove Doubles". After that, click "Tab" again to go back to Object mode and click "Smooth" under shading. It is important to remove duplicate vertices--if you don't, you get weird and ugly results if you try to use the modifier "Subdivision Surface" (which can make renders look better).

So, I followed Bort's advice. It turns out VMD has a lot more features than I thought. To export a scene using VMD:

1. From the menu, go to "Extensions" -> "Tk Console"

2. Type "render Wavefront system.obj". This will create system.obj and system.mtl in the current directory (you can navigate to a different one in Tk Console).

3. You're not done, because there's a bug as of VMD 1.9.1. Open the system.mtl file (preferably in something like Vim) and remove all of the underscores in the lines containing "illum_".

So: :%s/illum_/illum /g in Vim.