In this folder is the source code of the SafeGI CPU renderer and GPU renderer prototype.

Folder Content
-----------------------------------------------------------
ReadMe.txt
	-- This file.
typed
	-- The typed version of SafeGI CPU renderer and GPU renderer prototype. Refer to "typed\ReadMe.txt" for more information about the source code.
untyped
	-- The untyped version of SafeGI CPU renderer and GPU renderer prototype. Refer to "untyped\ReadMe.txt" for more information about the source code.
dep
	-- The OpenGL dependency file for the SafeGI GL renderer proejct.
	

Compilation Instruction
-----------------------------------------------------------
Both the SafeGI CPU renderer and GPU renderer should be able to be compiled using any C++ compilers that supports C++ 0x features. However, in this package, we only provide facilities to compile the source code using C++ compiler provided by Microsoft(R) Visual Studio 2010. The following section provides compilation instructions for 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. Please 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 project 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 "safegi_base.sln"
3. Double click "safegi_base.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.


** FreeGLUT and GLEW **
The SafeGI GPU renderer is linked to glut and glew library. Since glut is not a freeware, we deliver this package with freeglut and glew instead. The header files, lib files and the dll files are located in "dep" folder at the package root.


** Run Executable **
For SafeGI CPU ray tracer, please run the binary directly. For SafeGI GPU renderer, please copy the glew32.dll and freeglut.dll from "./dep/bin" folder to the folder where the executable located.



(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's 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 Intel¡¯s compiler provides us a significant speedup in our code. If you want to compile the source code using Intel¡¯s 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 "safegi_base.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. 



