RenderToolbox Install Mac OS/X
How to install the Render Toolbox and its components on OS/X
System Requirements:
- Mac OS X 10.4
- MATLAB (http://www.mathworks.com)
- Psychophysics Toolbox Version 3
- Autodesk Maya 7.0 or higher (www.autodesk.com/maya) -- Needed for Maya export functionality but currently only works on PPC Macs.
- Apple's XCode 2.4, which contains gcc 4.0 which you need if you want to want to custom compile PBRT_batchRender (http://developer.apple.com/tools/xcode/)
1. Download the Rendertoolbox Plus Installer, unzip it, and run the installer package. This will install 4 packages: OpenEXR, RenderToolbox, Radiance, and the SimToolbox. OpenEXR and Radiance will be installed in /usr/local and the toolboxes in /Users/Shared/Toolboxes.
2. Add RenderToolbox_2.0 to the MATLAB path:
- You can manually add the appropriate paths each time Matlab is opened by running:
addpath(genpath('/Users/Shared/Toolboxes/RenderToolbox/RenderToolbox_2.0')); addpath(genpath('/Users/Shared/Toolboxes/SimAll/SimToolbox')); path(RemoveSVNPaths);
- You can also have the RenderToolbox and SimToolbox added to your paths at startup time.
If you are in the Brainard lab, you can edit your section of startup.m. This file resides in /ColorShare/ToolboxesUse/BrainardLabToolbox/ and you edit the part under your username.
Specifically, under the line that begins with "paths2add" you will want to add the following 2 lines:
Specifically, under the line that begins with "paths2add" you will want to add the following 2 lines:
genpath('/Users/Shared/Toolboxes/RenderToolbox/RenderToolbox_2.0'), ...
genpath('/Volumes/ColorShare/ToolboxesUse/SimCityToolbox')];Otherwise, you'll need to determine your startup path (i.e. where startup.m resides).
In Matlab, you can find your startup path using the variable:
If this variable is not set, then your startup path is the default /Users/username/matlab where username is your account name.
Note that if this directory does not exist, you can just create it and everything will work fine.
In your existing startup.m file or a newly created one, add the lines:
3. Setup PBRT Unix environment variables.In Matlab, you can find your startup path using the variable:
userpath;
If this variable is not set, then your startup path is the default /Users/username/matlab where username is your account name.
Note that if this directory does not exist, you can just create it and everything will work fine.
In your existing startup.m file or a newly created one, add the lines:
addpath(genpath('/Users/Shared/Toolboxes/RenderToolbox/RenderToolbox_2.0'));
addpath(genpath('/Users/Shared/Toolboxes/SimAll/SimToolbox'));
path(RemoveSVNPaths);- Add an environment variable PBRT_SEARCHPATH to your system and set it to the the full path of PBRT_batchRender_1.1/bin. Also add this path to your system's searchpath. To do these things, first add to your ~/.bashrc file (can open this from any directory in a text editor) a line like:
export PBRT_SEARCHPATH="/Users/Shared/Toolboxes/RenderToolbox/PBRT_batchRender_1.1/bin"
export PATH=${PATH}:${PBRT_SEARCHPATH}and execute
$ source ~/.bashrc
4. Add the environment variable and search path into MATLAB's binary search path.
- To do this follow the general instructions here tutorial, that show how to add your Unix path to MATLAB using an environment.plist file. If you are in the Brainard lab, then the easiest thing to do is to select option 1 on that page and agree to the overwrite.
- After you've created the environment.plist file, you'll need to edit it to add the PBRT_SEARCHPATH environment variable. To do this, find the environment.plist file in your user directory in the .MacOSX folder and open it in a text editor. Add it in the same format that PATH takes using the <key><string> format, making sure it is placed between the extant <dict> ... </dict> tags. You must log off and on for any changes to take effect. So, for example, if you were in the Brainard lab your environment.plist file might look like this when you were done:
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-\ 1.0.dtd"> <plist version="1.0"> <dict> <key>PATH</key> <string>/bin:/sbin:/usr/bin:/usr/local/voxbo:/usr/local/stat/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/X11R6/bin:/usr/local/fsl/bin:/Volumes/ColorShare/UNIXStuff/bin:/usr/local/radbin_osx:/usr/local/openexr_bin:/usr/local/lib:/System/Library/Frameworks/Python.framework/Versions/2.3/bin:/Users/Shared/Toolboxes/RenderToolbox/PBRT_batchRender_1.1/bin</string> <key>PBRT_SEARCHPATH</key> <string>/Users/Shared/Toolboxes/RenderToolbox/PBRT_batchRender_1.1/bin</string> </dict> </plist>
- This process is very fussy. We've found that under some circumstances, the last entry on the search path isn't picked up by MATLAB. You can add a path /nil to the end of the PATH variable to fix this if necessary. White space in the environment.plist file may also be a problem, we're not entirely sure. Finally, you have to log in and out each time you edit the environment.plist file.
- If you discover a better way to set the environment for the Unix shell invoked by MATLAB under Mac OS/X, let us know. Under Linux, MATLAB seems to inherit the environment of the shell that invoked it, but not when launched in the standard manner under Mac OS/X.
5. If you have Maya installed and want to export from Maya, install the MayaPbrt plugin:
- Copy the file /Users/Shared/Toolboxes/RenderToolbox/mayapbrt_plugin/pbrtexport/pbrtexport.lib to the maya plug-ins folder. For example, to do this in the Brainard lab you could go to the pbrtexport folder and type cp pbrtexport.lib /Users/Shared/Alias/maya/plug-ins.
- In Maya, load the plug-in with Windows->Settings/Preferences->Plug-in Manager. Choose 'auto-load' if you would like to load it every time you start Maya.
- You don't need to do this if you just want to run the examples included with the toolbox.
6. Run BatchRender on the pre-made sphere example to test that everything is working correctly. (Well, this does not test the Maya plugin part.)
- In Matlab, cd into RenderToolbox/examples/simple_sphere folder.
- Make sure everything is cleaned out and run the script
unix('./clean.sh');
Render_BatchRender- If everything is configured correctly, it will render a sphere with both Radiance and PBRT. The results will be in the monitor_image_data subfolder.
There are 189 comments on this page. [Display comments]