Karim Machlab
HomeProjectsAboutContact
HomeProjectsAboutContact

Karim Machlab

Software & Game Developer

LinkedInYouTube
Ray Tracer

GRAPHICS & ANIMATION

Ray Tracer

Real-time ray tracer implemented in C++ with CUDA.

Overview

A Whitted-style ray tracer built from scratch, featuring BVH acceleration with Surface Area Heuristic splitting and CUDA-based GPU optimization for real-time rendering. Developed as a two-person academic project.

Showcase

Scene with 56K Triangles

Scene with 56K Triangles

Core Rendering Features

In this project, we implemented multiple material types, including diffuse, mirror, and glass, and supported geometric primitives such as spheres, planes, triangles, and complex meshes loaded from .obj files. We also created point lights for scene lighting, and an interactive camera system to navigate the 3D space. The camera can move left, right, up, down, inwards and outwards.

Acceleration & GPU Optimization

To improve performance, we implemented a Bounding Volume Hierarchy (BVH) structure, with node splitting determined using the Surface Area Heuristic (SAH). Since the BVH is constructed once at program startup, it significantly reduces intersection tests during rendering, resulting in substantial performance gains. Finally, we extended the ray tracer using CUDA to leverage the GPGPU, enabling real-time rendering of scenes with up to 100K triangles.

Tags

C++CUDA
← Back to GRAPHICS & ANIMATION