Skip to content

Computer Graphics 2 ray tracing project, "Graphics and Visualization" (TDT4230) course, spring 2025.

License

Notifications You must be signed in to change notification settings

Marko19907/Computer-graphics-2-project

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Computer Graphics 2 Project (TDT4230)

This repository contains the final project for the Graphics & Visualization (Computer Graphics 2) course at NTNU (spring 2025).

The goal of this project was to implement ray traced reflections and shadows using OpenGL Compute Shaders. The project was inspired by the new Indiana Jones game, specifically to observe ray traced self reflections on a trophy as seen in the game.

CMake Build

Screenshots

Screenshot 1 Screenshot 2

Screenshot 3 Screenshot 4

Features

  • Ray traced reflections and shadows, 1 primary ray + 2 secondary bounces (configurable)
  • Shadows via shadow rays toward every light
  • Toggleable ray tracing on/off
  • Toggleable trophy as a stress‑test
  • Fixed camera and free camera modes
  • Import and render any model in OBJ format

Controls

  • R - Toggle ray tracing on/off
  • T - Toggle trophy on/off
    • The trophy has a lot of triangles so it might be slow to render, recommended to hide it for better performance.
  • C - Toggle between fixed camera and free camera (WASD + arrow keys)
  • ESC - Exit the application

Usage

The project requires a GPU that supports OpenGL 4.3 or higher, there's no need for a GPU that supports hardware ray tracing

GitHub Releases [Recommended]

You can download the latest release GitHub Releases This is the preferred way to get a stable build.

GitHub Actions

You can also build the project using GitHub Actions. The workflow will build the project and upload an executable as a GitHub Artifact.

Building from Source

You can build the project from source too. The project uses CMake for building, to build and run the project, follow these steps:

  1. Clone the repository and initialize submodules in the current directory:
    git clone --recursive git@github.com:Marko19907/Computer-graphics-2-project.git .
  2. In the project directory, use CMake to generate the build files:
    cmake -B build
  3. Then build the project:
    cmake --build build

Limitations

  • The ray tracing is not optimized for performance, it is a basic implementation.
    • There's no acceleration structure, every ray is tested against every triangle in the scene.
    • No hardware ray tracing is used, only compute shaders.
  • Hard shadows only, no soft shadows.
  • No textures in the ray traced path, only solid colors.

About

Computer Graphics 2 ray tracing project, "Graphics and Visualization" (TDT4230) course, spring 2025.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published