Skip to content

Latest commit

 

History

History
169 lines (136 loc) · 8.64 KB

README.md

File metadata and controls

169 lines (136 loc) · 8.64 KB

Vulkan-Path-Tracer

Sponza

Physically based offline path tracer made in Vulkan with Ray Tracing Pipeline extension. It uses energy conserving BSSRDF with Diffuse, Dielectric, Metallic and Glass lobes + volume scattering. Renders can be saved as png images. It also features post processing effects and a denoiser.

System Requirements

  • Windows 10 and newer.
  • Either NVIDIA RTX 2000+ series or AMD RX 6000+ series to support all of the extensions below. You may check whether they're present on your device here, maybe it's possible to run on older hardware.
    • VK_KHR_ray_query,
    • VK_KHR_acceleration_structure,
    • VK_KHR_ray_tracing_pipeline,
    • VK_KHR_swapchain,
    • VK_KHR_deferred_host_operations,
    • VK_KHR_shader_clock,
    • VK_KHR_external_memory_win32,
    • VK_KHR_external_semaphore_win32,
    • VK_KHR_external_fence_win32,
  • Visual Studio 2022 (older versions might work but aren't tested).

Running

Windows Only

Building

Windows Only

  • Download Vulkan SDK.
  • Run git clone https://github.com/Zydak/Vulkan-Path-Tracer --recursive.
  • Go to Releases and download Shaderc.zip
  • Unzip and copy Shaderc libraries into Vulkan-Helper/lib/shaderc/.
  • Run setup.bat in main directory.
  • Open generated solution in Visual Studio.

Features

BSSRDF

BSSRDF implementation with Diffuse, Metallic, Dielectric, and Glass lobes alongside volumetric scattering. It uses Lambertian reflectance for diffuse surfaces and GGX for specular reflection and refraction made according to [Microfacet models for refraction through rough surfaces]. Specular reflection and refraction can also make use of Anisotropy that's implemented according to [Eric Heitz 2018] paper. Volumetric scattering is modeled with ratio tracking by doing a random walk using the Henyey-Greenstein phase function and Beer's law for realistic light transport through translucent materials and volumetrics, implemented according to [Production Volume Rendering 2017].

Energy compensation

Energy compensation implemented according to [Turquin 2018] paper.

Specular

Compensation Off:

MetallicNoCompensation

FurnaceMetallicCompensationOff

Compensation On:

MetallicCompensation

FurnaceMetallicCompensationOn

Difference:

DifferenceMetallic

FurnaceMetallicCompensationDifference

Glass

Compensation Off:

GlassNoCompensation

FurnaceGlassCompensationOff

Compensation On:

GlassCompensation

FurnaceGlassCompensationOn

Difference:

DifferenceGlass

FurnaceGlassCompensationDifference

Other

  • HDR Environment Maps
  • Environment map MIS
  • Textures and Normal Maps
  • Editor
    • Loading your own scenes in .gltf .fbx and .obj format
    • Editing scene materials in runtime
    • Exporting renders into .PNG files
    • Scene serialization
  • Post Processing
    • Bloom using Mip Maps
    • Chromatic Aberration
    • Exposure and many more
  • Anti Aliasing
  • Depth of Field effect with automatic focal length
  • Image Denoising using Nvidia Optix Denoiser
  • Camera controller made using quaternions

Gallery

Sponza Bistro DragonHead Archer OceanAjax CornellBox Mustang0 TeapotMarble TeapotTiled SubsurfaceBall Volume Dogs Caustics Display

Material Showcase

  • Metallic factor ranging from 0 to 1. Determines whether the surface is metallic or dielectric. metallic

  • Roughness factor on metallic surface ranging from 0 to 1. metalRoughness

  • Anisotropy factor on metallic surface with roughness 0.5 ranging from 0 to 1. Anisotropy-

  • Index of refraction (IOR) factor ranging from 1 to 3. Changes the strength of specular highlights on dielectric surfaces. specular

  • Roughness factor on dielectric surface ranging from 0 to 1. specRoughness

  • Specular Tint factor on dielectric surface ranging from 0 to 1. Gradually Tints the specular highlights to the surface color. specTint

  • Transparency factor ranging from 0 to 1. Determines whether the material is able to refract light rays or not. glass

  • Roughness factor on transparent surface ranging from 0 to 1. glassRoughness

  • Index of refraction (IOR) factor on transparent surface ranging from 1 to 2. Determines how much the path of light is bent during refraction. IOR

References

Papers Implemented

Models