Simple rendering engine on Vulkan that uses C++20 features.
Find a file
2023-09-01 16:29:23 +03:00
.vscode Updated libraries, Linux support, fmt library 2022-09-13 05:24:26 +03:00
assets WIP 2022-07-18 18:42:56 +03:00
shaders Fixed imgui HIDPI support 2023-08-30 22:23:44 +03:00
src Removed invisible character 2023-09-01 13:47:14 +03:00
.clang-format Initial commit 2021-12-06 20:49:04 +02:00
.clang-tidy .clang-tidy checks 2023-09-01 16:29:23 +03:00
.clangd Clangd location 2023-08-31 21:28:01 +03:00
.cmake-format Conan2 migration 2023-08-26 22:28:55 +03:00
.gitignore Adding generated cmake presets 2023-08-31 14:35:31 +03:00
CMakeLists.txt Conan2 migration 2023-08-26 22:28:55 +03:00
CMakePresets.json Release preset 2023-08-31 21:08:54 +03:00
conanfile.py Removed sound 2023-09-01 14:08:09 +03:00
README.md Changed debug to release in readme 2023-08-31 21:10:50 +03:00
suppressions.txt Excluded bindings from cppcheck 2023-08-31 21:37:00 +03:00

Vulkan engine

Simple rendering engine using Vulkan that works cross-platform on Windows, Linux and MacOS. Uses C++20 standard features. Currently, fmt library is used instead of std::format because it is not as of yet implemented in GCC.

Dependencies

Vulkan SDK has to be installed in the system. glslangValidator usually comes with the Vulkan SDK, but you might need to install it separately (for Arch, use yay -S glslang-git). For the rest of dependencies, I use conan package manager to pull them all. This project's dependencies can be seen in conanfile.py.

How to compile it

To compile the project, first you'll need to install conan to manage the dependencies. To install it, please refer to this conan installation guide.

Next, we're installing dependencies (replace Release with Debug if needed):

# We're building missing packages from source
conan install . -s build_type=Release --build=missing

Building with CMake

You can use a workflow preset to build the project:

cmake --workflow --preset release

Or you can do the same thing in two separate commands:

cmake --preset release # Configure
cmake --build --preset release # Build

Now, enjoy your freshly minted binaries inside the build/Debug/bin folder!

Baking assets

To load assets quicker, engine uses asset baking. Before launching it, you need to bake the assets using asset_baker that is one of the executables that were built:

# Execute this from project folder
./build/Release/bin/asset_baker ./assets/

Starting the engine

Internal code uses relative paths for loading models and shaders, so make sure that your working directory is the project root. Here's an example of how you can run the binaries:

./build/Debug/bin/vulkan-engine

Cleaning up build files

If you want to clean up the build files and binaries, you can just remove build folder:

rm -r build

Generating atlas maps

If you ever need to regenerate atlas maps for fonts, you need to use msdf-atlas-gen:

msdf-atlas-gen.exe -font ./assets/fonts/Roboto-Regular.ttf -format png -imageout ./assets/fonts/Roboto-Regular.png -charset ./assets/fonts/charset.txt -type mtsdf -dimensions 512 512 -pxrange 4