Interactive Ray Tracing

Published:

Interactive Ray Tracing

Team members: Yanling Hua, Ziyin Peng, Viviana Rinaldi
Tools: OpenGL · GLSL · C++ · CPU-based Rendering
Course: EDAN35 Computer Graphics, Lund University

Project Overview

Ever wondered how realistic lighting, reflections, and shadows are achieved in modern 3D environments?
Our Interactive Ray Tracing project brings those ideas to life by transforming a traditional ray tracing engine into an interactive and educational experience.

Inspired by Peter Shirley’s Ray Tracing in One Weekend series and enriched with OpenGL-based implementations, we created a CPU-driven real-time ray tracing application where users can manipulate the scene and visualize the effects of light and material interactions dynamically.

This isn’t just a renderer — it’s a sandbox for learning how light behaves.


Key Features

Real-Time CPU Ray Tracing Engine

  • Ray-sphere and ray-quad intersection detection
  • Lambertian, metal, and dielectric materials
  • Recursive ray tracing with adjustable depth
  • Basic Perlin noise textures and procedural generation
  • Rendering scenes pixel-by-pixel, entirely on CPU

Interactive GUI

Our custom user interface gives users full control over the rendering process:

  • Preview Mode: Move the camera with keyboard inputs in a low-sample fast mode
  • Default Mode: High-quality rendering with anti-aliasing
  • Sliders & Toggles for:
    • Ray depth
    • Sampling rate
    • Exposure level
    • Defocus blur settings
    • Motion blur switch

A Variety of Scenes

We built six visually distinct scenes to showcase different visual effects and ray tracing concepts:

SceneDescription
Simple LightBasic scene with diffuse lights and Perlin texture
QuadsFlat shaded objects with preview-enabled camera
Cornell BoxClassic boxed scene with soft lighting
Two SpheresChecker texture with Lambertian shading
Random SpheresRandomized materials and optional motion blur
Final SceneMixed elements: varied heights, textures, blur, and light

More details and visuals can be found in the project report.