How adlansadou/3d-vulkan-renderer works
Main Components
• Framework Module – Contains the core rendering engine implementation with Vulkan objects (e.g., VKDevice, VKRenderer, VKImage), helper and math utilities, and integration of ImGUI for immediate GUI support. It’s also where the cross-cutting concerns of graphics (shader compilation, buffer management, etc.) are developed.
• Game Module – Holds the game-specific logic and any tie-ins that connect the framework to the actual game content. It acts as the consumer of the Framework functionalities.
• Platform Module – Provides the entry point (main.cpp) and any platform-specific initialization or wrappers (possibly for SDL2 or similar libraries) which allow the engine to run on a specific operating system or hardware platform.
• Assets and Shaders – Represent external data that the engine uses, including models (GLTF files), textures (KTX images), lighting assets, and compiled shaders. There are build scripts (e.g., compile_shaders.bat) to preprocess these assets.
• Vendors and Third Party Libraries – Although not expanded in the architecture, components like SDL2, cgltf, stb_image, GLM, and ImGUI are integral and should be noted as external dependencies that integrate with the core engine.
Relationships and Interactions
• The Platform component initializes the application (via main.cpp) and sets up the runtime environment. It then invokes the Game module.
• The Game module leverages the Framework for rendering, manages game states, and handles high-level logic. It interacts with the Framework API functions and possibly uses assets from the assets directory.
• The Framework interacts with Vulkan and encapsulates low-level rendering operations. It manages devices, buffers, textures, and even integrates ImGUI for debugging or immediate GUI rendering.
• Assets and Shaders are loaded by the Framework (or Game) at startup, and any precompiled shaders are integrated into the Vulkan pipeline via files found in the shaders directory.
• External libraries (SDL2, etc.) are used across these modules to provide windowing, input, and other utilities even if not used directly for rendering.
Architectural Patterns and Design Principles
• Modularity: The separation into Framework, Game, and Platform allows for clear boundaries—decoupling low-level rendering details from game logic and platform management.
• Dependency Inversion/Abstraction: The game code likely calls abstracted interfaces from the Framework (instead of direct Vulkan calls), facilitating easier testing and extension.
• Integration of Third-Party Libraries: Clearly identify points where these libraries are injected or used (for example, ImGUI integration is visible in the Framework, and SDL2 might be used in the Platform layer).
Final Recommendations
• Every component is clearly labeled with its role (e.g., “Vulkan Renderer (Framework)”, “Game Logic”, “Platform Initialization”, “Asset Loader”).