In this folder is the source code of the SafeGI port of PBRT. 

Folder Content
-----------------------------------------------------------
ReadMe.txt
	-- This file.
typed
	-- The typed version of SafeGI port of PBRT.
untyped
	-- The untyped version of SafeGI port of PBRT.
	

Compilation Instruction
-----------------------------------------------------------
The SafeGI port should be able to be compiled using any C++ compiler that supports C++ 0x features. However, in this package, we only provided facilities to compile the source code using C++ compiler provided by Microsoft(R) Visual Studio 2010. The following section provides compilation instructions for browsing and compiling our source code. The typed version and untyped version of source code share the same compilation steps.


** Software Requirements **
- CMake 2.8
We use CMake to generate Microsoft Visual Studio solution and project files for our build. CMake is a freeware that can be downloaded from the following link: http://www.cmake.org/cmake/resources/software.html. Download CMake 2.8 or later and install it onto the machine.
	
- Visual Studio 2010
Our code can be compiled using Microsoft Visual Studio 2010. A trial version of Microsoft Visual Studio 2010 can be downloaded from the following link: http://www.microsoft.com/visualstudio/en-us/try/default.mspx.
	

** Build Steps **
- Build using Visual Studio 2010
1. Browse into the "./src" folder and look for a batch file named "cmake-msvs10.bat".
2. Double click to run "cmake-msvs10.bat". The batch file will generate a Microsoft Visual Studio 2010 solution file under "./obj/msvc10/" named "safe_pbrt.sln"
3. Double click "safe_pbrt.sln", which will bring up Microsoft Visual Studio 2010. Then, the project can be browsed and compiled.

** Executable Location **
The defualt location of the output executable is the "bin" folder. Inside "bin", two seperated folders will be generated for Debug build and Release build.


** (Optional) OpenEXR **
The images in our paper are generated using OpenEXR library. In order to reduce the dependency of this source package, we turned off the OpenEXR in our CMake file. The OpenEXR can be turn on by adding "PBRT_HAS_OPENEXR" as a preprocessing definition in Visual Studio project property. The OpenEXR libray can be download from the following link: http://www.openexr.com/downloads.html. For more detail about how OpenEXR work with PBRT, please consult the original PBRT building instruction and OpenEXR online documents.

** Run Executable **
The executable run with standard pbrt files format. However, since we only port a subset of PBRT features, please feed the program with pbrt files that only contain the ported featrues we described in the paper. 


(Optional) Build using Intel's Compiler.
-----------------------------------------------------------
Please note that, the performance results in our paper is generated by the executable compiled by Intel(R)'s C++ Compiler. Although the pacakge does not contain building facility for intel compiler, the following section will provide some brief information about the configuration. For more detail, please consult the manual of Intel's C++ Compiler, CMake and VS2008.

** Software Requirements **
- Intel Compiler 
The Intels compiler provides us a significant speedup in our code. If you want to compile the source code using Intels compiler, an evaluation edition of Intel(R) C++ Compiler Professional Edition can be download from the following link: http://software.intel.com/en-us/articles/intel-c-compiler-professional-edition-for-windows-evaluation/
	
- Visual Studio 2008 (optional)
Because Visual Studio 2010 is not fully supported by Intel's C++ compiler, we suggest that Microsoft(R) Visual Studio 2008, which Intel's compiler has fully support, should be used. An express edition of Visual Studio 2008 can be downloaded from the following link: http://www.microsoft.com/exPress/

** Build Steps **
1. Uses CMake 2.8 to generate a project solution for Visual Studio 2008. (Consult CMake manual)
3. Double click "safe_pbrt.sln", which will bring up Microsoft Visual Studio 2008. 
4. The VS2008 project needs to be converted into an Intel compiler project. To do this, right click on the pbrt project item in solution explorer than select "Intel C++ Compiler Pro"->"Use Visual C++.... Click "OK" to convert the project. After conversion, an Intel C++ icon should appear above the original project icon in solution explorer.
5. After the project file is successfully converted into Intel compiler project file, the C++ 0x support need to be turned on to compile the project. To turn on the C++ 0x support, right click on the project icon in solution explorer and select "Properties" to bring up the property dialog. Navigate to tag "C/C++"->"Language" and change the value of "Enable C++ 0x support" to "Yes".
6. Now the project can be browsed and compiled. 


