All Projects → cg-tuwien → Gears Vk

cg-tuwien / Gears Vk

Licence: other
Powerful low-level C++20 rendering framework for Vulkan 1.2, including Real-Time Ray Tracing (RTX) support, built atop Auto-Vk.

Programming Languages

1120 projects

Projects that are alternatives of or similar to Gears Vk

Vulkan based C++ ray-tracing game engine.
Stars: ✭ 24 (-66.2%)
Mutual labels:  engine, rendering, vulkan, raytracing
Nebula Trifid
Nebula Trifid
Stars: ✭ 62 (-12.68%)
Mutual labels:  engine, vulkan, rendering
Cross-platform, graphics API agnostic, "Bring Your Own Engine/Framework" style rendering library.
Stars: ✭ 10,252 (+14339.44%)
Mutual labels:  engine, vulkan, rendering
A modern cross-platform low-level graphics library and rendering framework
Stars: ✭ 2,142 (+2916.9%)
Mutual labels:  vulkan, rendering, raytracing
Cross-platform modern game engine.
Stars: ✭ 149 (+109.86%)
Mutual labels:  engine, vulkan, rendering
An efficient interactive C++ renderer for ShaderToy-alike demos with 2D/3D/CubeMap/Video/Camera/LightField/Volume textures. (Partially used in my I3D 2018 papers)
Stars: ✭ 62 (-12.68%)
Mutual labels:  engine, rendering, raytracing
Graphics API wrapper is written in C++ on top of Directx 12 and Vulkan. Provides main features including ray tracing.
Stars: ✭ 78 (+9.86%)
Mutual labels:  vulkan, rendering, raytracing
Yet Another Vulkan Engine
Stars: ✭ 211 (+197.18%)
Mutual labels:  engine, vulkan, rendering
OpenGL/OpenGL ES/Vulkan/CUDA/OptiX Modular Rendering Framework for PC/Linux/Android
Stars: ✭ 235 (+230.99%)
Mutual labels:  rendering, vulkan, raytracing
Easy to use 2D rendering engine using Vulkan API as backend.
Stars: ✭ 60 (-15.49%)
Mutual labels:  engine, vulkan, rendering
A 3D Engine built by two Game Engineering students.
Stars: ✭ 68 (-4.23%)
Mutual labels:  engine, vulkan
🌋🐎 Project Island is an experimental, hot-reloading Vulkan renderer/proto-engine for Linux, written in C/C++.
Stars: ✭ 441 (+521.13%)
Mutual labels:  engine, vulkan
C++ Metal wrapper
Stars: ✭ 425 (+498.59%)
Mutual labels:  engine, rendering
Some simple vulkan examples.
Stars: ✭ 413 (+481.69%)
Mutual labels:  engine, vulkan
Vk raytracing tutorial khr
Ray tracing examples and tutorials using VK_KHR_ray_tracing
Stars: ✭ 461 (+549.3%)
Mutual labels:  vulkan, raytracing
Engine Native
Native engine for Cocos Creator
Stars: ✭ 488 (+587.32%)
Mutual labels:  vulkan, rendering
Vk mini path tracer
A beginner-friendly Vulkan path tracing tutorial in under 300 lines of C++.
Stars: ✭ 599 (+743.66%)
Mutual labels:  vulkan, raytracing
Game engine with an emphasis on architectual quality and performance
Stars: ✭ 869 (+1123.94%)
Mutual labels:  engine, vulkan
A brief computer graphics / rendering course
Stars: ✭ 3,971 (+5492.96%)
Mutual labels:  rendering, raytracing
⚡️ 可编程渲染管线实现,帮助初学者学习渲染
Stars: ✭ 494 (+595.77%)
Mutual labels:  engine, rendering

Gears-Vk + Auto-Vk

Gears-Vk rendering framework for the Vulkan 1.2 API, implemented in modern C++, using C++17 and C++20 features.
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.

Gears-Vk is ready to go. If your system meets the system requirements (see section Installation below), everything is set up to build an run right out of the box. Just open visual_studio/gears-vk.sln, set one of the example projects as startup project, build and run.

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.


Currently, only Windows is supported as a development platform. The project setup is provided for Visual Studio 2019.


  • Windows 10
  • Visual Studio 2019 with a Windows 10 SDK installed (For detailed information about project setup and resource management please refer to visual_studio/
  • A Vulkan 1.2 SDK from LunarG, optimally Vulkan SDK or newer

Setup and build instructions:

  • Clone this repository
  • Execute a git submodule update --init to pull the Auto-Vk framework which is added as a submodule under auto_vk
  • Open the Visual Studio solution file visual_studio/gears-vk.sln, and build the solution
  • During building, you'll recognize messages from the Post Build Helper tool in Visual Studio's Output-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.
  • Several example applications are available in the solution file. Set one of them as startup project, and run.

Set up your own project:

  • To add Gears-Vk to one of your custom repositories, you might want to add it as a GIT submodule. You could execute git submodule add gears_vk to add Gears-Vk as submodule in directory gears_vk.
  • Execute git submodule update --init --recursive in order to pull both, Gears-Vk and the Auto-Vk framework.
  • The steps described under section Creating a New Project might be helpful for setting up a custom Visual Studio project that links agains Gears-Vk.

Creating a New Project

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:

  • Open create_new_project.exe and either select one of the example applications or enter the path to the project to be copied manually.
  • Enter the target location, the target project name, and hit the [Create it!]-button.
  • The project is copied to the target folder and all relative paths are adapted to the new location if the target folder is on the same drive as the source project. (If it is not, absolute paths are set.)
  • Asset references and shader references are retained and their paths are adapted.
    Attention: Make sure to remove the existing references if you are going to modify the referenced assets/shaders! You'll have to create copies of these files manually and add references to the copies instead. If you fail to do so, you'll end up modifying the stock assets or the examples' shader files.
  • Precompiled headers are disabled in the newly created project copy. If you'd like to use this feature, you'll have to manually enable it in Visual Studio's project settings.
  • Manually add a reference to the Gears-Vk library project gears-vk.vxcproj to your Visual Studio solution and ensure that the newly created project copy references it.
  • All source and include file references are removed from the newly created project copy. You'll have to add at least a .cpp file containing a main() function.
  • Add #include <gvk.hpp> to use Gears-Vk.
  • After these steps, you should be able to successfully link against Gears-Vk build your newly created project.

A good strategy is to add Gears-Vk 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 Gears-Vk's master branch to get the latest updates.

Resource Mangement and the Post Build Helper

Gears-Vk'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:

  • Add required 3D models, images, and ORCA scenes to the assets filter, and
  • add required shader files to the shaders 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/

You will notice Post Build Helper activity through its tray icon: . The tool will remain active after deployment has finished for two main reasons:

  • It allows to investigate logs from previous build events, and also change settings.
  • It continues to monitor resource files which is especially important to enable shader hot reloading.

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.

What's the difference between Gears-Vk and Auto-Vk?

Auto-Vk is a platform-agnostic convenience and productivity layer atop Vulkan-Hpp.

Gears-Vk establishes the missing link to the operating system -- in this case Windows 10 -- and adds further functionality:

  • Rendering environment configuration, such as enabling Vulkan extensions (e.g. if VK_KHR_raytracing shall be used, it selects an appropriate physical device and enables required flags and extensions)
  • Window management (through GLFW)
  • Game-loop/render-loop handling with convenient to use callback methods via the gvk::invokee interface (such as initialize(), update(), render(), where the former is called only once and the latter two are invoked each frame)
  • User input handling
  • A ready to use base class for object hierarchies: gvk::transform
  • A ready to use user-controllable camera class gvk::quake_camera (which is derived from both, gvk::transform and gvk::invokee)
  • Resource loading support for:
  • Material loading and conversion into a GPU-suitable format (gvk::material and gvk::material_gpu_data)
  • Lightsource loading and conversion into a GPU-suitable format (gvk::lightsource and gvk::lightsource_gpu_data)
  • Resource handling via Visual Studio's filters, i.e. just drag and drop assets and shaders that you'd like to use directly into Visual Studio's filter hierarchy and get them deployed to the target directory.
  • A powerful Post Build Helper tool which is invoked as a custom build step.
    • It deploys assets and shaders to the target directory
    • Shaders are compiled into SPIR-V
    • If shader files contain errors, popup messages are created displaying the error, and providing a [->VS] button to navigate to the line that contains the error within Visual Studio.
    • By default, "Debug" and "Release" build configurations symlink resources to save space, but "Publish" build configurations deploy all required files into the target directory so that a built program can easily be transfered to another PC. No more tedious resource gathering is required in such situations since that is all handled by the Post Build Helper.

Automatic Resource-Updates

See: Automatic Resource-Updates

FAQs, Known Issues, Troubleshooting

Q: Can Gears-Vk be used on Linux?
A: Not yet. Auto-Vk, however, can.

Q: Can Gears-Vk 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:

Q: 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".

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].