Difference between revisions of "File formats/Ray Tracing"

From Jmol
Jump to navigation Jump to search
m
 
(4 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
=== POV-Ray for Mac ===
 
=== POV-Ray for Mac ===
  
The following concerns POV-Ray for Mac, as of 15 Oct 2013. The latest official release for Mac from POV-Ray is 3.6, dating from somewhere around 2007. It runs only on Power PC Macs, not on Intel Macs, ie. it is not a Mac OS X Universal Binary (containing IBM Power-PC and Intel binaries).  Release 3.7 is available for Windows, and introduces SMP abilities, ie. can run on all cores of a chip. This appears to date from about 2009.
+
The following updates POV-Ray for Mac, as of Oct 2013. The latest official release for Mac from POV-Ray is 3.6, dating from somewhere around 2007. It runs only on Power PC Macs, not on Intel Macs, ie. it is not a Mac OS X Universal Binary (containing IBM Power-PC and Intel binaries).   
  
Mac OS X 10.6 can allegedly have the Rosetta IBM Power-PC emulator installed, see  http://support.apple.com/kb/ph6531  This was on by default in 10.5 and earlier, and was the means by which older Power-PC apps could be run on the Intel Macs. It is being phased out by Apple and I believe it could be problematic at 10.6.
+
For Windows, POV-Ray Release 3.7 is available, the main addition being SMP abilities, ie. it can run on all cores of a chip - useful for a ray-tracer which is an "embarrassingly parallel" type of code. This appears to date from about 2009.
  
However MegaPOV which is much more active has released a "3.7 Unofficial" release for Mac in 2013. Available at http://megapov.inetart.net/povrayunofficial_mac/index.html This runs ok on Mac OS X 10.6.8 (Snow Leopard) and allegedly later, ie. 10.7 Lion and 10.8 Mountain Lion. If you search for "povray 3.7 unofficial mac" you will find the announcements and some discussion.
+
Prior to OS X 10.6 (Snow Leopard) Macs used the Rosetta emulator to run Power-PC apps on the later Intel chips. However this is defaulted off in 10.6. It can be installed, see http://support.apple.com/kb/ph6531 However I believe that it is somewhat problematic at 10.6 or later.
  
 +
However MegaPOV which is a much more active POV-Ray extension has released a "3.7 Unofficial" release for Mac in 2013. Available at  http://megapov.inetart.net/povrayunofficial_mac/index.html  This runs ok on Mac OS X 10.6.8 (Snow Leopard) and allegedly later, ie. 10.7 Lion and 10.8 Mountain Lion. If you search for "povray 3.7 unofficial mac" you will find the announcements and some discussion.
  
The 3.7 Unofficial release appears to utilise 2 cores fully. It runs the model.pov and model.pov.ini files generated by Jmol 13.0.18 and produces fine images.
 
  
The technique which has worked for me is:
+
The MegaPOV 3.7 Unofficial release appears to utilise 2 cores fully. It runs the model.pov and model.pov.ini files generated by Jmol 13.0.18 and produces fine images.
 +
 
 +
The technique which has worked for me on 10.6.8 is:
 
* Adjust Jmol window size to 800x600
 
* Adjust Jmol window size to 800x600
 
* Get your Jmol scene how you want it.
 
* Get your Jmol scene how you want it.
Line 31: Line 33:
 
* Also in that panel, Tick 'Use Ini File', and specify scene.pov.ini
 
* Also in that panel, Tick 'Use Ini File', and specify scene.pov.ini
 
* Also in that panel, if any standard POV-ray include files are needed, specify <path>/POV-Ray 3.7Unofficial/include as a search path for includes.
 
* Also in that panel, if any standard POV-ray include files are needed, specify <path>/POV-Ray 3.7Unofficial/include as a search path for includes.
* In the panel Image & Quality, select 800x600. (This laborious matching of 800x600 is not fully necessary but it will get you going).
+
* In the panel Image & Quality, select 800x600. (This laborious matching of 800x600 is not fully necessary but it will get you going. Later you can play with sizes and aspect ratios).
 
* In Misc, you can also set a path for all output images, which overrides setting (*) above.
 
* In Misc, you can also set a path for all output images, which overrides setting (*) above.
  
 
Some examples are at http://ptmgallery.s3.amazonaws.com/list.html   
 
Some examples are at http://ptmgallery.s3.amazonaws.com/list.html   
  
I will try to find and document a command-line technique to do all the above, and to allow the direct Render button from the Jmol standalone app to work.
+
Using 2 cores (see the Render Pefererences panel, Bounding and Threads) only drops the render time from say 5 seconds to 4 seconds for a small molecule (amino acid) and not much different for a larger one (eg. 1GFL.pdb). You can see the two threads at times, when one falls behind the other on a time-consuming piece of the scene, and the checkerboard updates separately.
  
Update 17oct13: My research is showing that there is no command-line version of (Mega)POV-Ray Unofficial 3.7. Ie. running the app always launches into the full Gui version. You -may- be able to write basic settings to a scene.pov.ini file and launch the app to obey that, not succeeded yet.
+
There appears to be no command-line version of (Mega)POV-Ray Unofficial 3.7. Ie. running the app always launches into the full Gui version.
  
The Unix/Linux version can obviously run on Mac as well, and has command-line abilities. Useful discussion is at:
+
The Unix/Linux version of POV-Ray can run on Mac as well, and has command-line abilities. Useful discussion is at:
 
http://news.povray.org/povray.unix/  and   
 
http://news.povray.org/povray.unix/  and   
http://news.povray.org/povray.macintosh/
+
http://news.povray.org/povray.macintosh/ It would need to be built from source, which can vary greatly in difficulty depending mainly on how far the libraries needed have changed from the set used at the time (2007/8/9) . I have not put time into this.
 +
 
 +
===POV-Ray for Windows===
 +
 
 +
An update for POV-Ray on Windows, Oct 2013.  The following was tested on Windows 7, under Parallels 7 on Mac OS X 10.6.8.
 +
 
 +
The standard latest POV-Ray Windows release is 3.6.2. Can be downloaded from http://www.povray.org/download/#binaries . I used the 32 bit version.
 +
 
 +
Install POV-Ray 3.6 wherever you prefer, then run Jmol as a standalone app (by clicking in Windows Explorer, or java -jar Jmol.jar mymodel.pdb).  The POV-Ray icon on the menubar will bring up the dialog shown below. Fill in the location of the POV-Ray executable (pvengine.exe).
 +
 
 +
Hit Go. A dialog may pop up asking for special permission to read the Jmol.pov file, answer yes. (This is a POV-Ray security check, read the Help in the dialog for details). The molecule will then render.
 +
 
 +
POV-Ray 3.7 Beta adds SMP facilities. It worked fine and reduced render times by about 20%. I used the 32-bit version.
 +
 
 +
MegaPOV 1.2.1 for Windows appears to require POV-Ray 3.6 to be already installed, and expects some init files in precise default locations, and probably other assumptions. I did not pursue this further.
  
  
Line 48: Line 64:
 
[[Image:POV-RayExportDialog.png|POV-Ray export dialog]]
 
[[Image:POV-RayExportDialog.png|POV-Ray export dialog]]
 
</div>
 
</div>
 +
 
=== Saving from Jmol application ===
 
=== Saving from Jmol application ===
 
The application's top menu bar has  
 
The application's top menu bar has  

Latest revision as of 23:58, 29 October 2013

File Formats

File Formats for Ray Tracing Images Exported from Jmol

Recent versions of Jmol application and signed applet can export models to several high-quality image formats that can be displayed and edited in ray tracing programs like POV-Ray and Tachyon.

POV-Ray

Jmol can export, with limited features, the current view of a model into POV-Ray format. This can be done from script or from the pop-up menu, but is better controled using the top menu in the Jmol application, which opens a dialog with options.

Please, note that two files will be written: the main file and an additional one with a .ini extension appended (a typical example would be File icon.gifxxx.pov and File icon.gifxxx.pov.ini).

  • Home page for POV-Ray, the Persistence of Vision Raytracer.
  • Information on POV-Ray on Wikipedia.
  • Home page for MegaPOV, an extension of POV-Ray.

POV-Ray for Mac

The following updates POV-Ray for Mac, as of Oct 2013. The latest official release for Mac from POV-Ray is 3.6, dating from somewhere around 2007. It runs only on Power PC Macs, not on Intel Macs, ie. it is not a Mac OS X Universal Binary (containing IBM Power-PC and Intel binaries).

For Windows, POV-Ray Release 3.7 is available, the main addition being SMP abilities, ie. it can run on all cores of a chip - useful for a ray-tracer which is an "embarrassingly parallel" type of code. This appears to date from about 2009.

Prior to OS X 10.6 (Snow Leopard) Macs used the Rosetta emulator to run Power-PC apps on the later Intel chips. However this is defaulted off in 10.6. It can be installed, see http://support.apple.com/kb/ph6531 . However I believe that it is somewhat problematic at 10.6 or later.

However MegaPOV which is a much more active POV-Ray extension has released a "3.7 Unofficial" release for Mac in 2013. Available at http://megapov.inetart.net/povrayunofficial_mac/index.html This runs ok on Mac OS X 10.6.8 (Snow Leopard) and allegedly later, ie. 10.7 Lion and 10.8 Mountain Lion. If you search for "povray 3.7 unofficial mac" you will find the announcements and some discussion.


The MegaPOV 3.7 Unofficial release appears to utilise 2 cores fully. It runs the model.pov and model.pov.ini files generated by Jmol 13.0.18 and produces fine images.

The technique which has worked for me on 10.6.8 is:

  • Adjust Jmol window size to 800x600
  • Get your Jmol scene how you want it.
  • Use the Jmol Console to save a scene with "write POVRAY scene.pov" .. this produces scene.pov and scene.pov.ini
  • In POV-Ray Unofficial3.7, in Control Panel / Files & Paths, specify scene as your scene.pov, image as scene.png (*)
  • Also in that panel, Tick 'Use Ini File', and specify scene.pov.ini
  • Also in that panel, if any standard POV-ray include files are needed, specify <path>/POV-Ray 3.7Unofficial/include as a search path for includes.
  • In the panel Image & Quality, select 800x600. (This laborious matching of 800x600 is not fully necessary but it will get you going. Later you can play with sizes and aspect ratios).
  • In Misc, you can also set a path for all output images, which overrides setting (*) above.

Some examples are at http://ptmgallery.s3.amazonaws.com/list.html

Using 2 cores (see the Render Pefererences panel, Bounding and Threads) only drops the render time from say 5 seconds to 4 seconds for a small molecule (amino acid) and not much different for a larger one (eg. 1GFL.pdb). You can see the two threads at times, when one falls behind the other on a time-consuming piece of the scene, and the checkerboard updates separately.

There appears to be no command-line version of (Mega)POV-Ray Unofficial 3.7. Ie. running the app always launches into the full Gui version.

The Unix/Linux version of POV-Ray can run on Mac as well, and has command-line abilities. Useful discussion is at: http://news.povray.org/povray.unix/ and http://news.povray.org/povray.macintosh/ It would need to be built from source, which can vary greatly in difficulty depending mainly on how far the libraries needed have changed from the set used at the time (2007/8/9) . I have not put time into this.

POV-Ray for Windows

An update for POV-Ray on Windows, Oct 2013. The following was tested on Windows 7, under Parallels 7 on Mac OS X 10.6.8.

The standard latest POV-Ray Windows release is 3.6.2. Can be downloaded from http://www.povray.org/download/#binaries . I used the 32 bit version.

Install POV-Ray 3.6 wherever you prefer, then run Jmol as a standalone app (by clicking in Windows Explorer, or java -jar Jmol.jar mymodel.pdb). The POV-Ray icon on the menubar will bring up the dialog shown below. Fill in the location of the POV-Ray executable (pvengine.exe).

Hit Go. A dialog may pop up asking for special permission to read the Jmol.pov file, answer yes. (This is a POV-Ray security check, read the Help in the dialog for details). The molecule will then render.

POV-Ray 3.7 Beta adds SMP facilities. It worked fine and reduced render times by about 20%. I used the 32-bit version.

MegaPOV 1.2.1 for Windows appears to require POV-Ray 3.6 to be already installed, and expects some init files in precise default locations, and probably other assumptions. I did not pursue this further.


POV-Ray export dialog

Saving from Jmol application

The application's top menu bar has
File > Export > Render in POV-Ray
which produces images that can be displayed and edited in this ray tracing program (using a dialog with options).

There is also a button in the toolbar that invokes the same dialog. POV-Ray export from toolbar

Saving from Jmol application and signed applet

The pop-up menu also allows in these cases (not in the normal, unsigned applet) to save a snapshot of the model in POV-Ray format. Open the pop-up menu (right-click, or Ctrl+click, or click on Jmol frank) and choose File > Save (or directly Save in older versions). After choosing a format, a dialog will open to choose the location and filename. In this method, no other options for the export will be offered.

You can also export using a script (e.g. from the console) with the write command (see the scripting documentation).


Tachyon

Jmol can export, with limited features, the current view of a model into Tachyon format. Currently this can only be done from script.

Contributors

GregE, AngelHerraez