Running PBRT

PBRT is now installed on the public linux machines in the cs department. For a list of these machines you can issue the command "cshosts publinux" from any cs department machine. The executable for PBRT is /p/bin/pbrt/pbrt, you will need to make sure /p/bin/pbrt is in your PATH if you don't want to invoke the program with a full pathname. PBRT uses dynamically loaded library modules for most of its functionality. This makes it easily extensible without having to recompile the whole system. However, you will need to tell it where to look for its libraries for it to work. The way to do that is to set the environment variable PBRT_SEARCHPATH to a colon-separated list of full pathnames of directories in which PBRT library modules are to be found (just like any of the other types of PATH variables in UNIX). The libraries that came with PBRT are installed in /p/lib/pbrt, so the initial value to which you need to set PBRT_SEARCHPATH is /p/lib/pbrt. You can do this by giving the command "export PBRT_SEARCHPATH=/p/lib/pbrt" (sh, bash, ksh) or "setenv PBRT_SEARCHPATH /p/lib/pbrt" (csh).

Input files for PBRT are text files with the extension .lrt (PBRT used to be called LRT). A number of examples are available in /p/src/pbrt/scenes/. To create an image of one of these scenes, make a copy of it with the name "filename.lrt" in a working directory that is writable by you and execute the command "pbrt filename.lrt" from within that directory. If all goes well, you will see some output on your terminal screen indicating the degree of progress the ray tracer is making, and, when it terminates, it will have produced a file named pbrt.exr in your working directory. This is the image file in Industrial Light and Magic's high dynamic range exr format (http://www.openexr.org). That's probably not the best format right now for viewing the image since not many viewers recognize this format (yet), so we've got tools to produce other formats from that. The first step is to use /p/bin/pbrt/exrtotiff to convert pbrt.exr to a tiff file, for instance by executing "exrtotiff pbrt.exr filename.tiff".

If you want to convert the tiff file to other image formats, you can use the netpbm tools or xv to convert to just about anything you might like. For instance, you could view the file by executing "xv filename.tiff" and then write it out again from xv as a jpeg if you want a compressed version of the file.

Note that you will have some problems if your .lrt file contains references to geometry definitions. These refer to the paths ../geometry/ or ./geometry/, but all the actual definitions reside in /p/src/pbrt/geometry/ An easy fix for this is just to add a symlink to this directory in the appropriate place, e.g. for ./geometry/ references you'd need to add ln -s /p/src/pbrt/geometry/ geometry from within your working directory. The other case requires the same command to be issued from the parent of your working directory. We'll have a more flexible solution involving the use of PBRT_SOURCEPATH shortly. This won't be a problem if you use balls.lrt since it contains no such references.

There are other tools on the input side as well. For instance, you can convert Renderman .rib files to .lrt files for use with pbrt using /p/bin/rib2pbrt