PBRT Setup
(By Richard Sharp for last year's CSE 782 class)
This document should help you get PBRT built and set up for CSE 782.
The PBRT homepage is located at www.pbrt.org.
Linux setup
According to the authors, gcc version 3.3 or later is required to compile PBRT. However if you are attempting to compile PBRT on the SOC lab's lcc##e servers (Linux compute servers) you'll notice that only gcc v2.96 is installed. To get PBRT to compile you'll need to reference this document by Steven Bergner for modifications to make to various PBRT source files.
Carefully following the instructions in Steven's document I was able to get PBRT to compile although I ended up not having enough disk quota to render any images (took up about 333 Mb).
If you choose to set up PBRT on your Linux environment at home and run into problems please email me and I'll post them here (hopefully with solutions).
Windows setup
Personally, I built the system on Windows. If you do the same, make sure you have Cygwin installed (along with bison and flex in the Cygwin package) from www.cygwin.com. It is convenient if you install this package to c:\cygwin. Secondly you must have Microsoft Visual Studio 2003 installed (you can get a copy from the SOC lab if you don't have it).
Once your system meets these prerequisites you can install by following these steps:
-
Unzip the SOURCE.ZIP file from the WINDOWS directory from the CD-ROM that comes with the book. Personally I unzipped this file into c:\pbrt on my system. Thefiles will unzip into c:\pbrt\src.
-
Open the pbrt.sln file from the c:\pbrt\src\win32 directory and build the project (this will take a while, so go get a sandwich or wash your car). When the build is complete (hopefully error free) the pbrt.exe executable and plugin DLLs will be stored in c:\pbrt\src\win32\Projects\Debug.
-
Now you must modify your PATH and PBRT_SEARCHPATH environment variables so PBRT knows where to look for plugins etc. To do this edit your .bashrc file (in your Cygwin user directory, note that if you don't have a .bashrc file you can create one from scratch, or worst case, edit the systemwide .bashrc at /etc/bash.bashrc) and add the following lines:
export PBRT_SEARCHPATH=/cygdrive/c/pbrt/src/OpenEXR/bin:/cygdrive/c/pbrt/src/win32/Projects/Debug:$PATH
export PATH=$PBRT_SEARCHPATH:$PATH
Note.
The .../OpenEXR/... path allows you to access the OpenEXR utilities that allow you to view the .exr files created by PBRT. For more information about this file format visit www.openexr.com.
-
You also need to add a PBRT_SEARCHPATH variable to your windows environment. To do this in Windows XP go to:
Start->Control Panel->System->Advanced->Environment Variables
From here add a new user variable called PBRT_SEARCHPATH. I set mine to C:\pbrt\src\win32\Projects\Debug.
-
Now you can test PBRT by extracting the sample scene files (SCENES.ZIP) from the CD-ROM located in WINDOWS directory. I extracted them to my $HOME/pbrt Cygwin directory. Then from $HOME/pbrt/scenes I ran the command:
sharpr@jaguar ~/pbrt/scenes
$ pbrt simple.pbrt
and got the following output
pbrt version 1.000 of Sep 22 2004 at 16:57:33
Copyright (c)1998-2004 Matt Pharr and Greg Humphreys.
For educational use only; commercial use expressly forbidden.
Rendering: [+++++++++++++++++++++++++++++++++++++++++++++++++] (12.8s)
Statistics:
Camera
Camera Rays Traced 166.5k
Geometry
Total shapes created 1
Kd-Tree Accelerator
Avg. number of primitives in leaf nodes 1:1 (1.00x)
Leaf kd-tree nodes made 1
Maximum number of primitives in leaf node 1
Lights
Number of shadow rays traced 56.2k
Shading
Number of points shaded 56.2k
The result was a file called simple.exr which is the OpenEXR format described above. To view this file you can use a utility called exrdisplay.exe located in the /cygdrive/c/pbrt/src/OpenEXR/bin directory. I typed:
sharpr@jaguar ~/pbrt/scenes
$ exrdisplay.exe simple.exr &
And ended up getting a window that looked like:
-
If for some reason you are unable to link to or execute the OpenEXR binaries or libraries you may need to build them from source. You can do this by following the instructions in Steven Bergner's document in the section entitled "Rebuilding OpenEXR".