This project is part of the BEng Thesis "Design and Implementation of a Game Engine Using Vulkan Technology". The engine is separated into several modules. It implements a custom cross-platform window management system with runtime-switchable behavior. It also features a low-latency input system and a Vulkan-based renderer.
Core:
- testing framework
- debugging tools (logger, assertions)
- exception definitions
- runnable scripts
- synchronization classes (time synchronization)
- compiler attribute macros
- unknown-class definition for global class indexing
- includes of OS, C, and C++ headers (a custom STL implementation will be introduced in the future)
Application:
- window management abstraction layer over WinAPI, X11, and Cocoa, created using the policy pattern (strategy pattern)
- input management
- application status management, with exit condition declared via the AppStatus class
Math:
- matrices and vector implementations
- C++ operators for vector math
- geometric primitives
Rendering:
- Vulkan C++ wrappers
- renderer
- swapchain
- pipeline interface
- voxel raytracing pipeline
- sprite rendering pipeline
- shaders
System:
- relations between engine components
- job system
- event system
- reflection system (class names only, with the ability to create objects by requesting them via class name)
- different entry points for the application per operating system
- Windows
- Linux
- macOS (basic support through MoltenVK)
For rendering, it uses a voxel traversal algorithm implementation based on "A Fast Voxel Traversal Algorithm for Ray Tracing" by John Amanatides and Andrew Woo (1987), and Blinn-Phong reflection lighting.
The pipeline works entirely in a compute shader.
The technique was decided based on my knowledge of basic DDA algorithms and me dealing earlier with 2D ray casting in a project called AsciiRaycaster and having some basic knowledge about direct image rendering. This seemed faster and more interesting to implement than learning Vulkan's Acceleration Structures and hardware ray tracing shader pipeline. The pipeline was supposed to stay in this form until a suggestion to implement external physics appeared. At this point I had to figure out how to switch from cubes of voxels to some kind of independent structure. The idea was to start treating the voxels themselves as an acceleration structure and that gave me the possibility to decouple geometric figures (in this case cubes) from the voxel grid.
Currently work in progress. Uses vertex and fragment shader.
The project uses system prototypes that are available on my profile.
In the demo we can play a simple builder game where you can place and remove blocks. The demo uses Jolt Physics to showcase the project and test performance.
W - Move forward
S - Move backward
D - Strafe right
A - Strafe left
E - Fly up
Q - Fly down
Mouse movement - camera rotation
SPACE or LEFT MOUSE BUTTON - Place a block
X or RIGHT MOUSE BUTTON - Remove a block
1 - Weak push
2 - Medium push
3 - Strong push
Z - Debug view
Build dependencies:
- Vulkan SDK
- CMake or Visual Studio with CMake support
- Compiler that supports at least C++20
- Windows or Linux operating system
- X11 libraries (linux only)
sudo pacman -S --needed cmake make libx11 libxext libgcc libxi vulkan-tools vulkan-icd-loader vulkan-headers vulkan-utility-libraries glslang spirv-tools directx-shader-compilersudo apt install -y cmake make libx11-dev libxext-dev gcc libxi-dev vulkan-tools libvulkan-dev libvulkan1 glslang-tools spirv-toolsgit clone --recurse-submodules -j8 https://github.com/1mb33/B3.git &&
cd B3 &&
mkdir Build &&
cd Build &&
cmake .. -DCMAKE_BUILD_TYPE=Release &&
cmake --build .Run project from a bin directory that is created in root directory of the project Bin/TARGET_ARCH/BUILD_TYPE/.
Download the Vulkan SDK from a place like LunarG. If you are using Visual Studio, make sure to have CMake support installed.
Clone the project through Visual Studio's 'Opening' dialog. Open the root directory of the project with Visual Studio. Wait for CMake to build. Select the demo project called 'AtlBee' as a build target. Prefer the release build.
git clone --recurse-submodules -j8 https://github.com/1mb33/B3.git
cd B3
mkdir Build
cd Build
cmake .. -DCMAKE_BUILD_TYPE=Release
cmake --build .Run the project from a bin directory that is created in root directory of the project Bin/TARGET_ARCH/BUILD_TYPE/.
Get MoltenVK for Vulkan support on MacOS.
With the brew package manager you can get the needed tools to compile the project. For clang, download llvm package.
brew install llvm
For CMake, download cmake package.
brew install cmake
git clone --recurse-submodules -j8 https://github.com/1mb33/B3.git &&
cd B3 &&
mkdir Build &&
cd Build &&
cmake .. -DCMAKE_BUILD_TYPE=Release &&
cmake --build .






