CS 395T

PBRT on Windows


Jeff Diamond has reported some problems with getting pbrt to run decently on windows, and dealing with exr files on windows, when starting with pbrt source. I've confirmed running times equivalent to those of the prebuilt windows binary distributed with the book on the 1.02 version, but the build has to be done in Release mode, not the default (for the solution as distributed) Debug mode, using optimization O2 or Ox. This can be done by selecting the "Project" menu after you've started Visual C++ on the pbrt solution file ...\pbrt-src-1.02\win32\pbrt.sln, then selecting "Properties" at the bottom. In the resulting window, select "Configuration Manager" at the upper right. In the configuration manager, set "Active Solution Configuration" to "Release" (not "Debug"). This should set optimization to O2, you can check this by looking at "Optimization" under the C/C++ folder under the "Configuration Properties" folder to the left. Either O2 (the default for "Release" mode) or Ox should give good performance.

Another issue may be the need to install cygwin on your windows system in order to get access to lex and bison for building the command parser in the pbrt core. If you already have cygwin installed, you can ignore this part. If not, and you'd like to have Linux emulation under windows, I can highly recommend cygwin. However, it can take a lot of time and space to install. If you have no need for it other than to get lex and bison for this project, then here's a shortcut. Simply put the output files produced by lex and bison, pbrtlex.cpp, pbrtparse.cpp, pbrtparse.hpp, in your "core" directory. Then in Visual C++, open the Solution Explorer, and in it open the "core" project and go to the "Parser Files" folder. In it you will see "pbrtlex.l" and "pbrtparse.y". Highlight each of these in turn, and, while you have one of them highlighted, click on the property pages clipboard icon in the top left corner of the Solution Explorer. This will display the properties for the highlighted file. You should see the "Configuration Properties" folder in the large left hand window, and in large right hand window the first line should be "Excluded from Build" which is set to "no". Set this to "yes". Once this is done for both files, you can then build the project, and it should not attempt to use lex or bison to create the three files you have added to the build, but rather just build using the copies you put in the "core" directory.

You can use imageview.exe as distributed on the CD to view the .exr files. For those who need it, I've temporarily put it here, along with the glut library dll.