povray support on mac

Requests regarding how to set up experiments in ARGoS.
ifehervari
Posts: 3
Joined: Wed Mar 28, 2012 11:55 am

povray support on mac

Postby ifehervari » Wed Nov 14, 2012 12:52 pm

In the last couple of days I tried to find a way to use povray with argos. First of all, it does not work out of the box, but with little tweaks it is certainly possible to make it work.

1. Install pov-ray 3.7 on mac (any version)

The binary package offered on the official site is only for 3.6 which does not support command line arguments on the mac. One solution is to download the 3.7RC sources and build it, however it seems to be like a nightmare right now on the mac.

I think the easiest way it is to use macports (port install povray) since it will configure and install 3.7 out-of-the-box.

2. Run experiment the usual way selecting povray as visualization.

3. Correct files

The files produced by argos will most likely not work with the built in scripts such as render_all_frames_on_pc.sh or render_single_frame_on_pc.sh. In order to correct them you have to fix the location of your povray includes in ./ini/high_quality.ini or ./ini/low_quality.ini Macports installs povray in /opt/local/share/povray-3.7

Furthermore a small fix if you want to use the render_all_frames_on_pc.sh you have to change line 59 to povray ${SOURCES}/$i +L./include

At this point povray should run and process the images in your desired output folder as PNG files. Unfortunately, at my machine all the output files were extremely black.

4. correct gamma

In pov-ray 3.7 gamma settings are required, if not present if uses some algorithm to guess it which is quite bad (my experience). So one way is to add the gamma settings making the produced scene (.pov) files 3.7 compatible or to tell povray to process them as legacy scenes by adding #version 3.6; in each scene file.

Since both operations require the change of all files it is necessary to edit the povray_render.cpp's void CPovrayRender::WriteEnvironment( ) function.

For example:

...
"#include \"woods.inc\"\n" << "\n\n"

// Ensure compatibility, required for povray >3.6 since gamma correction is missing
<< "#version 3.6;" << "\n\n"
// Global setting
<< "global_settings { max_trace_level 5 } " << "\n\n"
...

5. making povray render to x11

So this is the point where I am right now. Even though I set the render_singe_frame_on_pc to send the output to x11 it just doesnt work (nothing appears, no error message)
In the original file and also argos2 calls this in the GUI the -visual DirectColor is still a mystery for me, I didnt find anything related to this and I dont have the directcolor.ini file (I assume it tries to load this)

Is this some linux specific configuration?

pincy
Site Admin
Posts: 632
Joined: Thu Mar 08, 2012 8:04 pm
Location: Boston, MA
Contact:

Re: povray support on mac

Postby pincy » Wed Nov 14, 2012 1:11 pm

First of all, thanks a lot for the detailed walkthrough! It is great news that ARGoS and POVRay can work on Mac. This was definitely an issue.

Regarding the necessary patches in ARGoS, I will make the necessary changes for version 3.7 of povray to work both on Linux and Mac.

Regarding the -visual option, the man page of povray on Linux is not very helpful. That option allows one to specify the number of bits dedicated to color images. It is definitely something X11 uses, but I can't say whether it would only work on Linux.

Thanks again! :-)
Carlo
I made ARGoS.


Return to “How to... ?”