Auto-Vk-Toolkit is a framework for the Vulkan graphics API, implemented in modern C++. It aims to hit the sweet spot between programmer-convenience and efficiency while still supporting full Vulkan functionality. To achieve this goal, this framework uses Auto-Vk, a convenience and productivity layer atop Vulkan-Hpp.
Auto-Vk-Toolkit has been successfully used for rapid prototyping, research (e.g., Conservative Meshlet Bounds for Robust Culling of Skinned Meshes, Fast Rendering of Parametric Objects on Modern GPUs), and teaching (e.g., Algorithms for Real-Time Rendering).
This image showcases some work that has been developed using Auto-Vk-Toolkit (from left to right): Usage in an advanced graphics course for teaching modern low-level GPU concepts; visualization of 19,600 spherical harmonics glyphs from a brain scan; division of meshes into meshlets and rendering them with fine-grained view-frustum and backface culling in task and mesh shaders; ray traced shadows and reflections using the hardware-accelerated real-time ray tracing device extensions; rendering of 358k parametrically-defined fiber curves in real time.
Some of its highlight-features (besides the awesome features of Auto-Vk) include:
update()
and render()
callbacks at varying or fixed update times.avk::root
implementation, with swap chain handling and automatic resource lifetime management..fscene
files from the ORCA: Open Research Content Archive.avk:buffer
or avk::image
instances, and also custom types; based on cereal.Auto-Vk-Toolkit is ready to go with Visual Studio or CMake. If your system meets the system requirements, everything is set up to build an run right out of the box. E.g., for Visual Studio, open visual_studio/auto_vk_toolkit.sln
, set one of the example projects as startup project, build and run!
Hint: The version on the development branch might be more up-to-date and contain additional features and fixes. Please consider using that version, especially if you encounter problems.
Note: At the first run, the Post Build Helper tool is being built. Watch Visual Studio's "Output" tab for status messages and possible instructions.
A preconfigured project setup is provided for Visual Studio 2022 on Windows.
visual_studio/README.md
.)git submodule update --init
to pull the Auto-Vk framework which is added as a submodule under auto_vk
Vulkan Memory Allocator header.
option so that the Vulkan Memory Allocator (VMA) library is installed. maintenancetool.exe
on Windows) by selecting the Vulkan Memory Allocator header.
option.Desktop development with C++
workload in the installer!Tools -> Options -> GLSL language integration
. For Vulkan shader development, either set Live compiling
to False
(syntax highlighting only), or set the External compiler executable file
to, e.g., the path to glslangValidator.exe
!visual_studio/auto_vk_toolkit.sln
, and build the solutionOutput
-tab, some popup messages, and an icon in the system tray. Please have a look at section Resource Mangement and the Post Build Helper for additional information.git submodule add https://github.com/cg-tuwien/Auto-Vk-Toolkit.git auto_vk_toolkit
to add Auto-Vk-Toolkit as submodule in directory auto_vk_toolkit
.git submodule update --init --recursive
in order to pull both, Auto-Vk-Toolkit and Auto-Vk.Please see docs/cmake.md!
Hello World | Multiple Queues | Compute Image Processing | ORCA Loader |
---|---|---|---|
Several example applications are included in this repository:
.fscene
files and render them; also how to use the serializerSkinned Meshlets | Ray Query and Ray Tracing | RTX Custom Intersection | Texture Cubemap |
---|---|---|---|
For Visual Studio projects, there is a convenience tool under visual_studio/tools/executables/
that can help to quickly set up a new project by copying an existing one (e.g. one of the example applications): create_new_project.exe
Use it like follows to create a copy of an existing project:
create_new_project.exe
and either select one of the example applications or enter the path to the project to be copied manually.auto_vk_toolkit.vxcproj
to your Visual Studio solution and ensure that the newly created project copy references it..cpp
file containing a main()
function.#include <auto_vk_toolkit.hpp>
to use Auto-Vk-Toolkit.A good strategy is to add Auto-Vk-Toolkit as a git submodule to your repository and use create_new_project.exe
and the steps above to create a properly configured project in a directory outside of the submodule. Make sure to frequently update the submodule by pulling from Auto-Vk-Toolkit's master
branch to get the latest updates.
Auto-Vk-Toolkit's Visual Studio projects are configured so that Visual Studio itself can be elegantly used for resource management. That means, required assets (3D models, images, ORCA scene files) and shader files can just be added to Visual Studio's filters in the "Solution Explorer" view and a smart Post Build Helper tool ensures that those resources are deployed to the application's target directory.
In short/TL;DR:
assets
filter, andshaders
filter
directly in Visual Studio. Then build the application, wait for the Post Build Helper to deploy these resources to the target directory, and run your application!This can look like follows, where the filters assets
and shaders
have special meaning, as hinted above:
A more detailed explanation and further instructions are given in visual_studio/README.md
.
You will notice Post Build Helper activity through its tray icon: . The tool will remain active after deployment has finished for two main reasons:
For more information about the Post Build Helper, please refer to the Post Build Helper section, and for more information about shader hot reloading, please refer to the Automatic Resource-Updates section below.
Auto-Vk is a platform-agnostic convenience and productivity layer atop Vulkan-Hpp.
Auto-Vk-Toolkit establishes the missing link to the operating system, like window handling, and adds further functionality:
VK_KHR_ray_tracing_pipeline
shall be used, it selects an appropriate physical device and enables required flags and extensions)avk::invokee
interface (such as initialize()
, update()
, render()
, where the former is called only once and the latter two are invoked each frame)avk::transform
avk::quake_camera
and avk::orbit_camera
(derived from both, avk::transform
and avk::invokee
)avk::material
and a vk::material_gpu_data
)avk::lightsource
and avk::lightsource_gpu_data
)[->VS]
button to navigate to the line that contains the error within Visual Studio.There are some documentation pages containing further information:
avk::updater
class, enabling shwapchain recreation and shader hot reloadingQ: Can Auto-Vk-Toolkit be used on Linux?
A: Yes. Please see the CMake documentation at docs/cmake.md!
Q: Can Auto-Vk-Toolkit be used without the Post Build Helper?
A: Yes. The Post Build Helper is a convenience tool that handles resource deployment, asset dependencies, and also file updates (useful for shader hot reloading, depending on the project structure). If you're not using it, you'll have to manage deployment of resources, and compilation of shader files into SPIR-V manually.
Q: I have troubles with asset management in Visual Studio. Any advice?
A: Check out Known Issues and Troubleshooting w.r.t. Asset Handling, which offers guidelines for the following cases:
Q: More resources have been deployed than I have added to Visual Studio's filters. What's going on?
A: Some assets reference other assets internally. For example, 3D models often reference images or material files (in case of .obj
models). These "dependent assets" are also deployed to the target directory by the Post Build Helper. Please see Deployment of Dependent Assets for more details.
Q: What are the differences between Debug, Release, and Publish build configurations?
A: In terms of compilation settings, Release and Publish configurations are the same. They link against Release builds of libraries. Debug configuration has classical debug settings configured for the Visual Studio projects and links against Debug builds of libraries. There is, however, a difference between Publish builds and non-Publish builds w.r.t. the deployment of resources. Please see Symbolic Links/Copies depending on Build Configuration for more details.
Q: I have troubles with the Post Build Helper. What to do?
A: Check out Post Build Helper, which offers guidelines for the following cases:
can't fopen
, or !RUNTIME ERROR! Couldn't load image from '...'
or similarQ: The application takes a long time to load assets like 3D models and images. Can it be accelerated?
A: If you are referring to Debug builds, you can configure Post Build Helper so that it deploys Release DLLs of some external dependencies even for Debug builds. They should accelerate asset loading a lot. To enable deployment of Release DLLs, please open Post Build Helper's settings and enable the option "Always deploy Release DLLs".
Q: Getting cereal::Exception
in cereal::loadBinary
, or Unhandled exception at 0x00007FFE82204FD9 in ...exe: Microsoft C++ exception: cereal::Exception at memory location ...
A: Your serialized cache file (e.g., for sponza_and_terrain.fscene
this could be sponza_and_terrain.fscene.cache
) has become corrupt (maybe because it was not fully written due to a previously occured error in the application, or because execution was aborted). Delete the cache file (e.g., sponza_and_terrain.fscene.cache
) and let a new one be generated!