A 2D and 3D renderer library that uses Vulkan. In a working state.
- 2D and 3D rendering
- Import and Draw models (only supports diffuse image textures)
- Skeletal animation
- Image textures loading and rendering
- Font loading and rendering
- Robyn Hood - 2022 - 2D On-rails Stealth Game
- Trials of The Pharaoh - 2022 - 2D Light Ray Puzzle Game
- The Last Dodo - 2022 - 2D Platforming Game
- Get Back Jaxx - 2022 -2D Adventure Game
- Hard Drive Homicide - 2021 - 2D Twin-Stick Bullet Hell Game
- Battle Island - 2021 - 2D Turn-Based Strategy Game
- included: volk dynamically loads pointers to vulkan from driver
- included: GLFW handles windowing and input
- included: GLM handles glsl datatypes and linear algebra
- included: stb_image.h handles image loading
- included OPTIONAL: Assimp handles model loading
- include OPTIONAL: freetype2 handles font loading
- external REQUIRED: Vulkan for vulkan type definitions, used by volk
This project uses CMake for building, and can be used as a submodule in your CMake Project if you want to use this library for your application.
There are some optional flags that can be set to change what is built.
They are used when generating the build files, so to build with examples without assimp you would call cmake /path/to/project/root -D BUILD_EXMAPLES=true -D NO_ASSIMP=true.
- pass
-DBUILD_EXAMPLES=trueto build the example binaries - pass
-DNO_FREETYPE=trueto remove the freetype dependancy from the library (font related functions will throw an exception) - pass
-DNO_ASSIMP=trueto remove the assimp dependancy from the library ( model related functions will throw an exception) - pass
-DASSIMP_BUILD_<Some Model Type>_IMPORTER=trueto enable the importing of models that this project doesn't by default. (By default only .fbx, .gltf and .obj model importers are built) - pass
-DVKENV_BUILD_STATIC=trueto have the library link agains the system's c runtime statically and link statically to dependancies - pass
-DBUILD_ASSIMP_STATIC=trueto have assimp linked statically (enabled ifVKENV_BUILD_STATICis enabled)
To get this project and all the submodules run $ git clone <this repo> --recurse-submodules
GLFW requires the dependancies of your windowing system if you don't have those already, detailed here.
Install the Vulkan SDK, for getting the vulkan headers and compiling shaders into spirv. make sure the headers can be seen by your compiler.
Install CMake if you haven't already
vulkan tools
$ sudo apt install vulkan-tools
vulkan loader / validation layers / spriv compilers
$ sudo apt install libvulkan-dev vulkan-validationlayers-dev spirv-tools
test vulkan works
$ vkcube
install cmake if you haven't already
$ sudo apt install cmake
make a build folder in the repo dir and go to it
mkdir build && cd build
setup the build, this is for an example setup for building with the demo in Release mode
cmake .. -D BUILD_DEMO=true -D CMAKE_BUILD_TYPE=Release
build the project
cmake --build .
You should then have an exectable VKenvDemo in build/demo/ that you can run
bugs:
- make first-person camera feel normal when fullscreen
features:
- make multiple render passes optional
- make the link between pipelines datatypes and model types more explicit
- customize shader / descriptor sets outside of render
- add tests
- C ABI
optimisations:
- use the same pipeline layout for multiple pipelines
- only buffer static object data to huge ssbo, use smaller one for things that change every frame
- check if animation is faster with array of shader buffers instead
- move visible api to include
- better loading and unloading of textures