Skip to content

A basic implementation of PBR (Physically Based Rendering) in Vulkan

Notifications You must be signed in to change notification settings

amitshky/VulkanPbr

Repository files navigation

vulkanPbr

A simple PBR (Physically-based Rendering) renderer implementation in Vulkan.

Prerequisites

Optional

(Install these if you want to run format.py (runs clang-format on all source files))

Clone

Clone with --recursive

git clone --recursive https://github.com/amitshky/vulkanPbr.git

Build and Run

  • Configure and build the project with -DVKPBR_USE_PRE_BUILT_LIB=OFF to build the static libraries. This will also copy the libraries into the binaries/ directory. You can then build with -DVKPBR_USE_PRE_BUILT_LIB=ON to use those libraries while building instead of building them from scratch.
cmake -B build -S . -DVKPBR_USE_PRE_BUILT_LIB=OFF
cmake --build build
  • Then navigate to the output file and run it (run it from the root directory of the repo). For example,
./build/<path_to_executable>

OR (in VSCode)

  • Start debugging (Press F5) (Currently configured for Clang with Ninja and MSVC for Windows) (NOTE: This will build with -DVKPBR_USE_PRE_BUILT_LIB=ON)

OR (using bat scripts from scripts folder)

  • Run them from the root directory of the repo (NOTE: This will build with -DVKPBR_USE_PRE_BUILT_LIB=ON).
./scripts/config-clang-rel.bat
./scripts/build-clang-rel.bat
./scripts/run-clang.bat
  • To format all the source files according to .clang-format styles,
python format.py

Usage

  • Left-click and drag the mouse to move the camera
  • Left-click and WASD to move the camera forward, left, back, and right respectively.
  • Left-click and E and Q to move the camera up and down.
  • R to reset the camera
  • Ctrl+Q to close the window

Screenshots

Model loading

Skybox added

PBR implementation

References

About

A basic implementation of PBR (Physically Based Rendering) in Vulkan

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published