Lachei / VulkanPBRT

Vulkan physically based raytracer including denoising
MIT License
28 stars 11 forks source link

VulkanPBRT

Vulkan physically based raytracer including denoising.

The GPU raytracer is based on Vulkan only, as well as for the denoising only the Vulkan Compute capabilities will be used.

For faster and easier development the VulkanSceneGraph library is used. It provides an easier interface to Vulkan, has resource management included and allows pipeline setup via a scene graph. Further GLSL like math classes are included.

The raytracer itself is intended to be easily customizable to be used for different tasks. The implementations done here should provide a good working baseline. To make this possible, all rendering related classes here are only doing setup code with the vsg library. All resources used for rendering are put into public attributes, which can then be forwarded to the scene graph structure. To record the pipeline and other needed resources see the example use in VulkanPBRT.cpp.

Current Project Status

The todos, in progress and done tasks can be found in the Projects tab.

A list of supported features and screenshots (Top is most recent feature):

sponza denoised bfr

sponza texture pbr lighting sponza texture pbr lighting

sponza texture pbr lighting

sponza texture shadow

sponza easy

Compilation Notes

This project depends on the Vulkan library to be installed, so head over to the Vulkan Website and download the appropriate SDK.

The basis for implementation is the VulkanScenGraph (VSG) library. All needed files of VSG are included in this repository and do not have to be installed.

Further the threads, xcb and assimp libraries are needed and have to be found by cmake via a find_package call.

The shaders for the projects are automatically compiled by cmake when the project is built. If you should change the source code of the shaders this compilation will automatically be re-run on the next build instruction.

To build the project, simply

cd VulkanPBRT
mkdir build
cd build
cmake -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
make -j 8

(the -j 8 instruction for the make command enables multi threaded compilation)

pre-commit

If you would like to contribute to this repository, please set up pre-commit in your local git repository.

Vsg Notes

The local copy of the vsg library is being held up to date via git subtree.

In order to update vsg, vsgXchange and vsgImGui open a terminal in the VulkanPBRT folder and type the following commands:

git subtree pull --prefix external/vsg git@github.com:vsg-dev/VulkanSceneGraph.git master --squash 
git subtree pull --prefix external/vsgXchange git@github.com:vsg-dev/vsgXchange.git master --squash 
git subtree pull --prefix external/vsgImGui git@github.com:vsg-dev/vsgImGui.git master --squash 

For more information about how to use more complex git subtree commands see the subtree manual.