GitHub - gavrix32/hwrt: Hardware Accelerated Ray Tracer written in C++ and Vulkan · GitHub
Skip to content

gavrix32/hwrt

Folders and files

Repository files navigation

⚡ Hardware Accelerated Ray Tracer (HWRT)

A high performance, physically based, progressive Path Tracer built from scratch using C++20 and Vulkan

License Windows Linux Vulkan C++

🖼️ Showcase

Amazon Lumberyard Bistro (exterior) Amazon Lumberyard Bistro (exterior)

Amazon Lumberyard Bistro (interior) Amazon Lumberyard Bistro (interior)

Crytek Sponza Crytek Sponza

📈 Visual Comparison & Convergence Metrics

The table below demonstrates the visual and mathematical impact of each sampling technique at 64 samples per pixel (spp) compared to the fully converged ground truth reference.

Metric / Method Uniform (Naive) BRDF Importance Next Event Estimation Multiple Importance Sampling Reference
Render Preview Uniform Importance NEE MIS Reference
RMSE 0.170272 0.150286 0.011463 0.011457 -
Convergence Boost 1x 1.28x 220.66x 220.88x -

✨ Features

  • Vulkan Ray Tracing Pipeline
  • Unidirectional Path Tracing
  • Frame Accumulation
  • Cook-Torrance BRDF
  • Physically Based Materials
  • Next Event Estimation
  • Multiple Importance Sampling
  • glTF 2.0 Scene Loading
  • Mesh Instancing
  • Procedural Atmosphere
  • Shader Hot Reload
  • Khronos PBR Neutral Tone mapping
  • Anti-Aliasing

🖥️ Requirements

  • OS: Windows 10/11 (x64) / Linux (x64)
  • GPU: NVIDIA Turing (RTX 20 series) / AMD RDNA 2 (RX 6000 series)
  • Vulkan SDK: 1.4
  • Compiler: C++20 (GCC, Clang or MinGW)
  • CMake: 3.20
  • Shader Compiler: The Slang compiler slangc must be on your PATH if you want to use the Reload Shaders feature

⚙️ Build & Run

Clone

git clone --recursive https://github.com/gavrix32/hwrt.git
cd hwrt

# If you cloned without submodules
git submodule update --init --recursive

Linux

# Compile shaders (only needed after editing them)
chmod +x src/shaders/compile.sh
./src/shaders/compile.sh

mkdir build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build . -j$(nproc)
./hwrt -m ../assets/models/cornell_box.glb

Windows

:: Compile shaders (only needed after editing them)
src\shaders\compile.bat

mkdir build && cd build
cmake ..
cmake --build . --config Release
hwrt.exe -m ..\assets\models\cornell_box.glb

📃 License

Copyright © 2026 Dmitry Gavrilov

Distributed under the MIT License.

About

Hardware Accelerated Ray Tracer written in C++ and Vulkan

Topics

Resources

License

Stars

Watchers

Forks

Packages

Contributors