A minimal, low-level Vulkan demo that sets up a custom graphics pipeline and showcases the Dirac Plate trick implemented in GLSL shaders.
Example fragment shader demonstrating the Plate Trick.
- Minimal Vulkan setup with explicit graphics pipeline configuration
- Custom GLSL vertex and fragment shaders
- Implementation of the Dirac delta trick for impulse-like rendering effects
- Clean structure suitable for further expansion or educational use
- CMake
- VCPKG (for dependency management)
- Vulkan SDK
- A C++20-capable compiler
- Download from LunarG Vulkan SDK
- Extract and follow their setup instructions (add to
PATH
etc.)
git clone https://github.com/microsoft/vcpkg.git
cd vcpkg
./bootstrap-vcpkg.sh
./vcpkg install glfw3 glm fmt imgui volk vulkan
# configure and resolve dependencies
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="$env:USERPROFILE\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows
# compile and link
cmake --build build --config debug
# run
./bin/debug/demo
Only tested on arch so far.
Ubuntu:
sudo apt update
sudo apt install build-essential cmake git pkg-config \
libvulkan-dev vulkan-validationlayers-dev \
libglfw3-dev libglm-dev libfmt-dev
Arch Linux:
sudo pacman -Syu --needed base-devel cmake pkgconf \
vulkan-icd-loader vulkan-validation-layers \
glfw-x11 glm fmt nvidia nvidia-utils libglvnd \
lib32-nvidia-utils vulkan-driver vulkan-tools \
- For AMD GPUs: replace
nvidia nvidia-utils lib32-nvidia-utils
withvulkan-radeon lib32-vulkan-radeon
. - For Intel GPUs: replace with
vulkan-intel lib32-vulkan-intel
. vulkan-tools
providesvulkaninfo
for troubleshooting.libglvnd
ensures proper OpenGL/Vulkan dispatch.- Make sure your user is in the
video
group:sudo usermod -aG video $USER
- Reboot after installing drivers.
cmake -S . -B build -DCMAKE_TOOLCHAIN_FILE="$HOME/vcpkg/scripts/buildsystems/vcpkg.cmake"
cmake --build build --config debug
./build/demo
- If you installed dependencies via your package manager, you can omit the
-DCMAKE_TOOLCHAIN_FILE=...
argument.