Skip to content

tylertms/vk-pathtracer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

419 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vk-pathtracer

Warning

This repository is deprecated in favor of https://github.com/tylertms/vkrt

Interactive, physically-based pathtracing engine using the Vulkan API. Includes full camera control, a custom BVH builder, glTF 2.0 loader, and more. This is a hobby project for my own learning and likely has many naive implementations. Ajax

Table of Contents

Requirements

  • Windows, Mac, or Linux
  • Vulkan SDK with API v1.2+
  • GCC/Clang with C++17
  • CMake v3.20+

Compilation

Mac & Linux:

git clone https://github.com/tylertms/vk-pathtracer
cd vk-pathtracer
cmake -B build -DCMAKE_BUILD_TYPE=Release
cmake --build build -j4
./build/bin/vk-pathtracer

Windows:

Install Visual Studio, MinGW, MSYS, or another C++ toolchain.

git clone https://github.com/tylertms/vk-pathtracer
cd vk-pathtracer
cmake -B build -DCMAKE_BUILD_TYPE=Release

If a Makefile generator cannot be found, include the -G flag with your corresponding generator, i.e., MinGW Makefiles or MSYS Makefiles.

cmake --build build -j4
.\build\bin\vk-pathtracer.exe

Features

  • GPU-accelerated pathtracing algorithm
  • Fully interactive scene (rotate/zoom/pan)
  • Control of camera FOV, focal distance, focal strength, exposure, etc.
  • glTF 2.0 loader
  • Position objects and adjust material properties from the sidebar
  • Mix diffuse, specular, metallic, and dielectric BxDFs
  • HDR environment mapping (equirectangular)
  • ACES HDR tone mapping
  • Partial texture support
  • Save and load scenes using YAML files
  • And more...

Roadmap

  • Hardware raytracing support (VK_KHR_ray_tracing_pipeline)
  • Top level acceleration structure for scenes with many meshes
  • Improved glTF texture support and object hierarchy
  • BVH optimizations, construction through compute shader
  • Wavefront pathtracing (a fundamentally different approach to light transport)

Issues

  • Scene saving/loading is currently broken
  • Creating new scenes is buggy and will sometimes crash the program
  • Textures may not always be detected and may load incorrectly

Gallery

Dragon Lucy DragonGlass Spheres

References

Vulkan Tutorial - Alexander Overvoorde

Ray Tracing in One Weekend - Peter Shirley

Coding Adventure: Ray Tracing - Sebastian Lague

Coding Adventure: Optimizing a Ray Tracer (by building a BVH) - Sebastian Lague

Physically Based Rendering: From Theory To Implementation

How to build a BVH - Jacco Bikker

RayTracingInVulkan - GPSnoopy

Debug Views

Normal Vector (x/y/z) as Color (r/g/b) Normal Number of Ray-Box Tests BoxTests Number of Ray-Triangle Tests TriTests

About

Interactive pathtracing engine using the Vulkan API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors