This project implemented ray tracing on GPU (NVIDIA CUDA). It also includes our implementations of various optimization techniques for benchmarking performance and identifying best practices.
![]() Rendering spheres with circulating light source |
![]() Real-time interactive with TriangleMesh rendering |
Before building the project, ensure you have the following installed:
- NVIDIA CUDA Toolkit
- GCC (for compiling the CPU code)
- NVCC (NVIDIA CUDA Compiler)
To build the project, you can use the provided Makefile
. The Makefile
includes various targets for building different versions of the rendering programs.
To build all targets, simply run:
make all
The Makefile
defines several targets for building different versions of the CUDA rendering and optimization programs:
realtime
: Compilesrealtime_render.cu
for real-time rendering.global
: Compilesglobal_launcher.cu
for global memory access.array_bvh
: Compilesdifferent-versions/array_bvh.cu
for BVH with array storage.optimized
: Compilesoptimized.cu
for general optimizations.optimized_vertices-in-shared
: Compilesdifferent-versions/optimized_vertices-in-shared.cu
for shared memory optimization.optimized_non-coalesced
: Compilesdifferent-versions/optimized_non-coalesced.cu
for non-coalesced memory access optimization.optimized_bvh-tree
: Compilesdifferent-versions/optimized_bvh-tree.cu
for optimized BVH tree.optimized_bvh-texture
: Compilesdifferent-versions/optimized_bvh-texture.cu
for optimized BVH using textures.optimized_recursive
: Compilesdifferent-versions/optimized_recursive.cu
for optimized recursive BVH.cpu
: Compilescpu_launcher.cpp
for CPU rendering using OpenMP.
After building the targets using the make
command (e.g., make all
or make <target>
), you can run the respective executables. Here are examples of how to run some of the programs:
./realtime # Run the real-time rendering program
./global # Run the global memory access program
./array_bvh # Run the BVH with array storage program
./optimized # Run the general optimizations program
The code has only been tested on Linux machines (Ubuntu) with CUDA and OpenGL installed.
Project Members: Cong VU, Minh PHAM, The NGUYEN