4
$\begingroup$

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

$\endgroup$
3
  • $\begingroup$ I've traditionally used PovChem for the purpose, but there might be nicer packages out there... $\endgroup$ – J. M. Jun 19 '13 at 3:06
  • 1
    $\begingroup$ 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. $\endgroup$ – Bort Jun 21 '13 at 15:08
  • $\begingroup$ molscript/povscript can be used to generate povray input. It does pretty good job, though it is tricky to use. $\endgroup$ – permeakra Aug 4 '13 at 22:24
2
$\begingroup$

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).

Hope this is helpful!

$\endgroup$
1
$\begingroup$

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.

  4. Download Blender: http://www.blender.org/download

  5. Download Luxrender (a physically based state-of-the-art light transport solver): http://www.luxrender.net/en_GB/download

  6. From here, follow the instructions included with Luxrender to get it working with Blender. Then you can import your system.obj. You can then modify the materials to be whatever you like for Luxrender, along with the camera settings and a whole bunch of other stuff.

I'll add a sample rendering of mine here in a little while.

$\endgroup$
1
  • $\begingroup$ Blender is full of rendering win! $\endgroup$ – meawoppl Aug 7 '13 at 16:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.