This is the companion CD to Physically Based Rendering: From Theory to Implementation, by Matt Pharr and Greg Humphreys. The CD contains the source code to the pbrt rendering system, prebuilt binaries for a number of architectures, example scene files and images, and browsable hyperlinked source code to the system. All content is Copyright (c)2004 Matt Pharr and Greg Humphreys. See the file license.txt for the software license.

The contents of this CD were finalized on April 14, 2004. Please visit the pbrt website, www.pbrt.org, to check for bug fixes, updates to the system, additional plug-in modules and scene files.

Contents:

Windows Installation Notes

The relevant files are in the windows/ directory of the CD. Create a new directory on your hard drive (we'll assume it's c:\pbrt for the discussion below) and unzip the files below into it. (You can omit some of these, depending on how you plan to be using the system.)

The windows/ directory on the CD contains the following files:

Next, set your PBRT_SEARCHPATH environment variable (Start/Settings/Control Panel/System/Advanced/Environment Variables). If you are running the prebuilt binaries and unzipped them into c:\pbrt, this environment variable should be set to c:\pbrt\bin\win32. If you are building the system from source, it should be set to c:\pbrt\src\bin. You should add this directory to your PATH environment variable as well.

After closing the window to set the environment variables, open a new command prompt and change to the example scenes directory:

cd c:\pbrt\examples

Render a simple scene:

pbrt.exe simple.pbrt

To view the image, which is stored in EXR format, you can either use the included imageview binary, or you can convert it to a TIFF:

imageview.exe pbrt.exr

or

exrtotiff pbrt.exr pbrt.tif

Additional information about the EXR file format is at www.openexr.com.

Building the system on Windows

You MUST have Microsoft Visual Studio 2003 installed. You also must have bison and flex installed from the Cygwin Unix tools, available from www.cygwin.com. The build process assumes that the Cygwin tools are installed in c:\cygwin, the standard location.

After unzipping the sources zip file, open the pbrt.sln file from the src/win32/ directory. Select a debug or release build and build the project. The pbrt.exe executable and the plugin DLLs will be stored in src/win32/Projects/Debug or src/win32/Projects/Release, as appropriate.

Make sure that your PBRT_SEARCHPATH and PATH environment variables are set to point to the appropriate binaries that you built and not the supplied prebuilt binaries.

Linux/Mac/Unix Installation notes

The files you'll need to install the system are stored in gzipped tar files, in the unix/ directory:

Create a new directory to store pbrt (we'll assume it is $HOME/pbrt in the discussion below), and untar the appropriate ones into it:

mkdir $HOME/pbrt
cd $HOME/pbrt
tar xvzf /mnt/CDROM/unix/source.tgz
tar xvzf /mnt/CDROM/unix/examples.tgz
tar xvfz /mnt/CDROM/unix/images.tgz
tar xvzf /mnt/CDROM/unix/source.tgz
tar xvzf /mnt/CDROM/unix/linuxbin.tgz / tar xvzf /mnt/CDROM/unix/macbin.tgz

Note that the path to the CD's filesystem may be different on your system.

Next, set your PBRT_SEARCHPATH environment variable and add the pbrt binaries directory to your search path. Where to set this depends on the shell you're using. For bash, add the following to your .bashrc file:

export PBRT_SEARCHPATH=$HOME/pbrt/bin/linux  # or bin/osx for Mac OSX
export PATH=PBRT_SEARCHPATH:$PATH

For tcsh, add the following to your .tcshrc file:

setenv PBRT_SEARCHPATH $HOME/pbrt/bin/linux  # or bin/osx for Mac OSX
setenv PATH $PBRT_SEARCHPATH:$PATH

For other shells, consult your shell's manual page.

If you are building pbrt from source, instead set the PBRT_SEARCHPATH variable to point to the $HOME/pbrt/src/bin directory.

Now, open a new shell (or otherwise set the above environment variables in an already-existing shell) and render a simple scene:

pbrt simple.pbrt

After rendering is complete, the file pbrt.exr will be created, holding the image. To view it, either use an image viewing program that supports EXR format, or use the included exrtotiff program to convert it to TIFF format:

exrtotiff pbrt.exr pbrt.tif

On linux, the imageview program, found in bin/linux/imageview, can be used to view EXR files.

Additional information about the EXR file format is at www.openexr.com.

Building the system on Unix

In order to easily build the system, you MUST have gcc version 3.3 or later installed. Otherwise, you must download and build the OpenEXR libraries yourself, and modify the Makefile to use the ones you built, as the precompiled ones we supply are not compatible with earlier versions of gcc due to a change in the link format for C++ with gcc version 3.3. (Type "gcc -v" to see its version.)

After untaring the sources, change to the src/ directory and type make. By default, a version with debugging symbols and no optimization is built. (It is much slower than the optimized version.) To build an optimized version, type make OPT=-O2, or use your preferred compiler optimization flags as appropriate.

The binaries will be installed in the src/bin/ directory. Set your PBRT_SEARCHPATH and PATH environment variables to point to that directory and not the supplied prebuilt binaries.

Acknowledgments

The bunny, buddha, and dragon models are from the Stanford University Scanning Repository and are included with permission. The TT car model, Sponza atrium, and Sibenik cathedral model are courtesy Marko Dabrovic and Mihovil Odak from RNA Studios. The Killeroo model is included with permission of Phil Dench and Martin Rezard of headus. The ecosystem scene was created by Oliver Deussen and Bernd Lintermann.

The smoke datasets are the result of simulations by Duc Nguyen and Ron Fedkiw; Nolan Goodnight created environment maps with a realistic skylight model; and the Cornell Program of Computer Graphics Light Measurement Laboratory allowed us to include measured BRDF data.

The imageviewer program was written by Cliff Woolley at UVA.

images/figures/01F11.png is by Guillaume Poncin and Pramod Sharma

images/figures/01F12.png is by Rui Wang

images/figures/01F13.png is by Eric Lee

images/figures/01F15.png is by Jared Jacobs and Michael Turitzin