RenderToolbox是由宾夕法尼亚大学(University of Pennsylvania)的David Brainard, [email protected]; Chris Broussard, [email protected]开发的一个基于Radiance和PBRT引擎的Matlab工具箱。http://www.rendertoolbox.org/wikka.php?wakka=HomePage
目前RenderToolBox提供了MacOS/X和Linux的安装版本。我们这里只讲下在Ubuntu下的安装。
安装该软件包之前需要安装Radiance,OpenEXR,PBRT,MATLAB,Subversion命令,Psychtoolbox。
1)安装Matlab
http://blog.csdn.net/lqhbupt/article/details/7853440
2)安装Radiance
sudo apt-get install radiance
3)安装OpenEXR
http://blog.csdn.net/lqhbupt/article/details/7854442
4)安装LibTIFF
在官网http://www.libtiff.org/下载文件tiff-3.8.2.tar.gz
sudo tar -zxvf tiff-3.8.2.tar.gz -C /usr/local/
cd /usr/local/ tiff-3.8.2
sudo ./configure
sudo make
sudo make install
(5)安装Psychtoolbox-3
选择相应的Ubuntu版本和镜像后,得到下载NeuroDebian软件库的命令
wget -O- http://neuro.debian.net/lists/precise.jp | sudo tee/etc/apt/sources.list.d/neurodebian.sources.list
sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
sudo apt-get update
sudo apt-get install mricron
sudo apt-get install octave-psychtoolbox-3
Matlab进入/usr/share/psychtoolbox-3目录
终端命令行输入
sudo chmod a+w -R /usr/local/MATLAB/R2012a/toolbox
在Matlab命令窗口输入:
SetupPsychtoolbox
根据提示,在终端安装缺少的软件。
(6)安装SVN命令
sudo apt-get install subversion
(7)安装RenderToolbox和SimToolbox
sudo mkdir /usr/share/RenderToolbox
sudo mkdir /usr/share/SimToolbox
sudo svn cohttps://platypus.psych.upenn.edu/repos/rendertoolbox/trunk /usr/share/RenderToolbox
sudo svn cohttps://platypus.psych.upenn.edu/repos/simtoolbox/trunk /usr/share/SimToolbox
将RenderToolbox_2.0和SimToolbox加入MATLAB路径
打开Matlab,在命令窗口输入:
>>addpath(genpath('/usr/share/RenderToolbox/RenderToolbox_2.0'));
>>addpath(genpath('/usr/share/SimToolbox'));
编译安装PBRT_batchRender
打开终端,输入:
cd /usr/share/RenderToolbox/PBRT_batchRender_1.1
sudo make clean
sudo make
将PBRT_batchRender_1.1/bin加入系统环境变量
打开~/.bashrc文件加入如下两行:
export PBRT_SEARCHPATH=”/usr/share/RenderToolbox/PBRT_batchRender_1.1/bin”
export PATH=${PATH}:${PBRT_SEARCHPATH}
编译安装PBRT_original
cd /usr/share/RenderToolbox//PBRT_original
sudo make clean
sudo make
打开PBRT_original目录下的pbrt_org文件,将第一行和最后一行更改为用户的目录。
第一行:
PBRT_SEARCHPATH="/usr/share/RenderToolbox/PBRT_original/bin"
最后一行:
/usr/share/RenderToolbox/PBRT_original/bin/pbrt$*
cd /usr/local/bin
sudo ln -s /usr/share/RenderToolbox/PBRT_original/pbrt_orig .
cd /usr/share/RenderToolbox/Utilities/exrtofloat
sudo make clean
sudo make
cd /usr/local/bin
sudo ln -s /usr/share/RenderToolbox/Utilities/exrtofloat/exrtofloat .
测试RenderToolbox是否安装成功
在Matlab命令窗口
>>cd /usr/share/RenderToolbox/examples/table_sphere
>>unix('./clean.sh');
>>Render_BatchRender
如果一切配置成功,则会在当前文件夹下创建monitor_image_data子文件夹,其中保存分别用Radiance和PBRT渲染出来的图片。
遇到问题及解决方案:
1)core/paramset.h:100:error: extra qualification ‘ParamSet::’ on member ‘ParamSet’
解决方法:在core/paramset.h中,将"ParamSet::~ParamSet()"替换为"~ParamSet()".
film/image_raw.cpp:22:error: extra qualification ‘ImageFilm::’ on member ‘ImageFilm’
解决方法:ImageFilm::ImageFilm(intxres, int yres,前面的ImageFilm::去掉
shapes/sphere.cpp:25:error: extra qualification ‘Sphere::’ on member ‘Sample’
shapes/sphere.cpp:32:error: extra qualification ‘Sphere::’ on member ‘Sample’
shapes/sphere.cpp:59:error: extra qualification ‘Sphere::’ on member ‘Pdf’
解决方法:将对应行的Sphere::去掉
accelerators/kdtree.cpp:98:error: extra qualification ‘KdTreeAccel::’ on member‘KdTreeAccel’
解决方法:将对应行的KdTreeAccel::去掉
2)Lex'ingpbrtlex.l
core/pbrtlex.l:82:bad character:
core/pbrtlex.l:82:name defined twice
core/pbrtlex.l:88:bad character class
core/pbrtlex.l:88:unrecognized rule
core/pbrtlex.l:88:unrecognized rule
core/pbrtlex.l:88:unrecognized rule
core/pbrtlex.l:88:unrecognized rule
core/pbrtlex.l:88:unrecognized rule
core/pbrtlex.l:132:bad character class
core/pbrtlex.l:132:unrecognized rule
解决方法:在core/pbrtlex.l文件中,将第82行修改为
WHITESPACE[ \t\j]+
3)Linkingbin/pbrt
/usr/local/lib/libIlmThread.so:undefined reference to `sem_init'
解决方法:打开Makefile文件,在EXRLIBS=-lIlmImf-lImath -lIex -lHalf -lz
行后添加-lpthread
4)convert.cpp:12:fatal error: ImfRgbaFile.h: No such file or directory
解决方法:打开Makefile文件,将
INCLUDE=/opt/local/include/OpenEXR
LIBDIR=/opt/local/lib
更改为
INCLUDE=/usr/local/include/OpenEXR
LIBDIR=/usr/local/lib