Skip to content

Real-time ray tracer renderer that allows to move freely in the scene with the keyboard and mouse, while streaming live the results from the GPU to the screen. Implemented using C++ with CUDA.

Notifications You must be signed in to change notification settings

Sahar-E/Raytracer

Repository files navigation

Ray Tracer

Introduction


Real Time Ray Tracer

This Ray Tracer Renderer provides the ability to move freely in the scene with the keyboard and mouse, while streaming live the results from the GPU to the screen.

Table of Contents
  1. About The Project
  2. Getting Started
  3. Usage
  4. Demo Videos and Screenshots
  5. Citations

About The Project

This project is a ray tracer / path tracer visualizer that provides a way to move freely in the scene with the keyboard and mouse similar to a free camera in a world. The tracing algorithm is calculated on the GPU using the CUDA C++ toolkit. The program is written mainly in C++20 and CUDA-C++17 and built with cmake. To present the result in realtime, I used OpenGL with glfw, glew to have a windowed program and also ImGui to have a simple UI.

(back to top)

Getting Started

Prerequisites

  1. Make sure you have the CUDA toolkit installed and have NVIDIA nvcc compiler installed.
  2. Have cmake 3.8+ installed.

(back to top)

Installation

  1. Clone the repo
    git clone https://github.com/Sahar-E/Raytracer.git raytracer
  2. cd raytracer && mkdir build && cd build
  3. cmake ..
  4. cmake --build .

(back to top)

Usage

Launch the application executable. To move the camera, use the following keybindings:

  • W - move the camera forward.
  • S - move the camera backward.
  • D - move the camera right.
  • A - move the camera left.
  • SPACE - move the camera up.
  • SHIFT+SPACE - move the camera down.
  • MOUSE_PRESS_LEFT + MOUSE_MOVEMENT - pan the camera according to the mouse movements.

(back to top)

Demo Videos and Screenshots

Example video for Real Time raytracing:

youtube demo video

Screenshot of the program:

Screenshot Example

Screenshot of the save from the video:

Screenshot Example

Last rendered image:

Image Render Example

(back to top)

Citations and sources

(back to top)

About

Real-time ray tracer renderer that allows to move freely in the scene with the keyboard and mouse, while streaming live the results from the GPU to the screen. Implemented using C++ with CUDA.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published