Skip to content

pratik-dhende/Raytracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Raytracer

finalScene
Figure 1: CPU render showcasing motion blur, BVH (AABB), texture mapping, Perlin noise, quad primitives, area lights, instancing, and constant-density media.

cudaSpheres
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.

Performance Comparison

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)

Features

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

Technological Stack

C++ • CUDA • CMake

How to Run

  • The project uses CMake as the meta build system.
  • CUDA version >= 12.6 and MSVC are required for the cuda branch.

Check out the respective branch:

git checkout main    # If CPU
git checkout cuda    # If CUDA

Configure CMake

cmake -S . -B build

Release

cmake --build build --config Release

Debug

cmake --build build --config Debug

About

CPU & GPU Raytracer Exploration

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors