- Physically Based Rendering - Realistic lighting and reflections with energy-conserving materials
- Progressive Rendering - Image quality improves over time with live, frame-by-frame refinement
- Anti-Aliasing - Smooth edges using subpixel jitter and sample accumulation
- HDR Environment Maps - Skybox lighting with exposure (EV) control
- Procedural Sun - Adjustable directional light simulating sunlight
- Scene Management - Load and edit scenes via JSON files
- Interactive UI - Responsive ImGui interface with dockable panels and image export
- GPU Path Tracing - Using OpenGL and GLSL
- Material System - Diffuse, specular (glossy/mirror), emissive, smoothness and procedural checker flag
- Cosine-Weighted Hemisphere Sampling - Physically accurate diffuse light distribution
- Russian Roulette Termination - Unbiased path termination for efficient global illumination
- sRGB Gamma Correction - Converts linear output to perceptual colour space
- Geometry Primitives - Spheres, infinite planes, and quads
To build this project from source, you will need the following prerequisites:
- C++ 17+ Compiler (e.g., GCC, Clang, MSVC)
- CMake 3.16+
- OpenGL 4.4+ drivers and development libraries (usually part of your graphics card driver installation)
- You do not need to install any dependencies in order to build the project :D
- GLAD and single header files (nlohmann/json, stb) are included in
external/
folder - Other dependencies are managed as git submodules:
- GLFW
- GLM
- ImGui
- ImGuiFileDialog
Tested on Windows 11 with MSVC. Untested, but should also build on Linux with GCC or Clang.
git clone https://github.com/Brooklyn-Dev/ray-tracing.git
cd ray-tracing
# Initialise and update all git submodules recursively
git submodule update --init --recursive
# Create build directory and run CMake
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Release ..
# Build the project
cmake --build . --config Release
# Run the executable
cd bin/Release
ray-tracing.exe
- Download the latest release from the Releases page
- Extract the archive to your desired location
- Run the executable
- File Menu - Load scenes and export renders
- Camera
- Movement (relative) - Arrow keys
- Up/Down - Space / LCtrl
- Rotate - LMB + Drag
- ImGui Windows
- Viewport - Displays the render output
- Settings - Adjust gamma, bounces, samples, skybox, sun, camera, etc.
- Bounding Volume Hierarchy (BVH)
- Refraction and transmission materials
- Real-time scene editor
- Mesh loading (OBJ, glTF)
- Image-based textures
- Depth of field
- Support for more geometry types (cubes, torus, etc.)
- Basic video render with animated camera path
- Environment maps by Poly Haven (CC0)
- Inspired by Sebastian Lague's ray tracing devlog
- Inspired by NamePointer's ray tracing devlog
- Ray Tracing in One Weekend
- The Cherno's Ray Tracing series
If you find this project interesting or useful, consider giving it a star ⭐️!
This project is licensed under the MIT License. See LICENSE for more information.