Figure 1: CPU render showcasing motion blur, BVH (AABB), texture mapping, Perlin noise, quad primitives, area lights, instancing, and constant-density media.
Figure 2: GPU render showcasing ray–sphere intersection, gamma correction, Lambertian, metallic (with fuzz), and dielectric materials (with total internal reflection and Schlick approximation), dynamic camera, and defocus blur.
| Configuration | Value |
|---|---|
| Resolution | 1200×675 |
| Samples Per Pixel | 500 |
| Max Bounce Depth | 50 |
| Acceleration | Speedup | Time (hh:mm:ss) |
|---|---|---|
None |
1x |
00::42::49::688 (2569.69 seconds) |
CPU + BVH |
5.67× |
00:07:32.982 (452.983 seconds) |
CUDA (no BVH) |
10.44× |
00:04:06.148 (246.148 seconds) |
This project explores building a Raytracer from scratch, with both CPU and CUDA-accelerated versions.
| Feature | CPU Branch | CUDA Branch |
|---|---|---|
| Ray–Sphere Intersection | ✅ | ✅ |
| Gamma Correction | ✅ | ✅ |
| Lambertian Material | ✅ | ✅ |
| Metal (with fuzz) | ✅ | ✅ |
| Dielectric (TIR + Schlick) | ✅ | ✅ |
| Dynamic Camera | ✅ | ✅ |
| Defocus Blur | ✅ | ✅ |
| Motion Blur | ✅ | ❌ |
| Bounding Volume Hierarchy (AABB) | ✅ | ❌ |
| Texture Mapping | ✅ | ❌ |
| Perlin Noise | ✅ | ❌ |
| Quadrilateral Primitive (Ray–Plane Intersection) | ✅ | ❌ |
| Area Lights | ✅ | ❌ |
| Instance Translation/Rotation | ✅ | ❌ |
| Constant-Density Media | ✅ | ❌ |
C++ • CUDA • CMake
- The project uses CMake as the meta build system.
- CUDA version >= 12.6 and MSVC are required for the cuda branch.
git checkout main # If CPU
git checkout cuda # If CUDAcmake -S . -B build
cmake --build build --config Release
cmake --build build --config Debug