My personal path tracer for exploring graphics programming and testing out new rendering techniques.

-
Multiple Backends: Implements path tracing with both Vulkan hardware-accelerated ray tracing (via the official Vulkan ray tracing extension) and a compute-shader fallback.
-
Path Tracing with MIS: Uses unidirectional path tracing with multiple importance sampling (MIS). Supports combined Lambertian diffuse and GGX specular materials.
-
Scene Loading: Supports loading scenes from Wavefront
.obj
files and Khronos.gltf
files. -
Material System: Full Disney PBR support with albedo, roughness, metallic, normal, transmission, opacity, and emission.
-
ImGui Interface: Provides a user interface to edit scene parameters, including camera settings, scene graph, and material properties in real-time.
-
Cross-Platform: Supports Windows, MacOS, and Linux.
- Vulkan SDK: Ensure the Vulkan SDK is installed and the
VULKAN_SDK
environment variable is set. - CMake: Version 3.10 or higher.
- Compiler: A C++23-compatible compiler. MinGW is recommended (on Windows) due to usage of the
#embed
directive in the source code.
Clone the repository including its submodules:
git clone --recursive https://github.com/Ka1serM/VulkanToyPathtracer.git
cd VulkanToyPathtracer
-
Create a build directory:
mkdir build cd build
-
Configure the project with CMake (MinGW + Release mode):
cmake .. -G "MinGW Makefiles" -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON
-
Build the project:
cmake --build . --config Release
-
Run the executable:
The output executable will be located in the
build/
directory.
The shaders are compiled using glslc
from the Vulkan SDK. A recompile.bat
script is provided in the src/Shaders
directory to automate this process.
-
Navigate to the shader directory:
cd src/Shaders
-
Run the script:
recompile.bat
This script compiles GLSL shaders to SPIR-V bytecode using
glslc
.
This project uses the following libraries (included as submodules):
- SDL3
- Dear ImGui
- GLM
- portable-file-dialogs
- tinyobjloader
- tinygltf
- stb_image