The old repo was used to create a new one with a lot of re-work and new feature additions. It’s a forward clustered renderer.
Tools added
- Cmake (re-worked): The modern cmake style which allowed targets to be exported and linked with dependencies via generator expressions. A cleaner approach compared to the legacy version.
- Vcpkg: Package manager which allowed to bring in the dependencies on the host machine rather than packing it in the git repo. Submodules were skipped as there weren’t any needs to have direct access of the source code for any of the external library dependencies. The glfw, when used as submodule, used to give hardcoded paths from the host, in case of library export.
- TinyGltf: Gltf loader for loading scenes along with textures using the in built support for stb. Although the ktx support would have been a nice additional in-built feature.
- Ktx: Texture loader for ktx files which were used in skyboxes.
- Graphviz: The render graph visualization.
Features added
- Rendergraph: In order to manage the multipass rendering an entity with the knowledge of all the passes and resources was required, as it allowed the decision-making ability to reside on a level higher than within passes itself. The passes were not concerned with resource transitions which were handled by rendergraph. Detailed explanation of the implementation can be found in below links.
Conundrum Of Multipass Rendering. Rendergraph implementation | by QuadBit | Medium
Rendering setup with Rendergraph. Command buffer submissions and… | by QuadBit | Medium
The clustered light culling pipeline with multiple passes has the graph shown below.
2. Clustered light culling: The algorithm to manage multiple lights efficiently was implemented with dual compute pass. The compute passes were responsible for creating the clusters and assigning lights to their respective clusters. More details can be found in the below link.
GPU driven clustered light culling | by QuadBit | Apr, 2024 | Medium
3. Shader reflection: The old repo was dependent on a third party tool to generate shader reflections which failed with SSBO. A new reflection generator was implemented by using spirv-reflect, although it is still dependent on some LunarG assets. The assets will be replaced with an executable containing all the libs statically linked, but in future.
4. Bounds rendering: The AABB and sphere bounds were visualized via a debug pass.
5. Vulkan dynamic rendering: Replaced the old VkRenderPass and VkFrameBuffer objects with new vulkan dynamic rendering concept. Vulkan dynamic rendering. Let go vulkan renderpass and… | by QuadBit | Medium
6. Vulkan command buffer generation and synchronizations managed by rendergraph. Rendering setup with Rendergraph. Command buffer submissions and… | by QuadBit | Medium
Re-work:
Removed a lot of ugly raw pointers, but they still reside in ECS. Re-designed the entire renderer to accommodate the new rendergraph. Improved naming conventions and an overall safer, robust code design.
Future plan for the next layoff :)
Remove the remaining raw pointers and replace the existing ECS with Flecs. Add anti-aliasing, shadows, frustum and occlusion culling. More of C++ 20 usage.
Code :
quad-bit/Loops2: Vulkan renderer with rendergraph (github.com)