This video is a development log for the Hazel game engine, celebrating a major milestone in the "Renderer 2025" project: the first successful rendering using a new backend built on NVIDIA's NV-RHI (Render Hardware Interface). The developer details the process of rewriting the engine's core rendering systems to support multiple graphics APIs like Vulkan and DirectX. Key technical challenges and their solutions are discussed, including resolving a significant memory leak by properly implementing NV-RHI's command buffer garbage collection and navigating the complexities of its resource binding offset system, which bridges the gap between HLSL and Vulkan. The update also covers the creation of a new, fully custom renderer for the Dear ImGui UI, providing tighter integration with Hazel's window management and moving away from example backends. The video concludes by affirming that the foundational rendering pipeline is now operational, paving the way for the full implementation of the 3D scene renderer.
Hazel's New Renderer: Progress, Quirks, and Next Steps
0:00 - Milestone Achieved: For the first time, the Hazel game engine is rendering its user interface and a basic 3D scene (represented by bounding boxes) using its new "Renderer 2025" backend, powered by NVIDIA's NV-RHI library.
1:43 - Open Development: The entire development process is being live-streamed on Twitch, with VODs available on the "Cherno Unplugged" YouTube channel. Full source code access, including the new renderer branch, is available to Patreon supporters.
4:43 - A Strategic Approach: To tackle the massive task of rewriting the renderer, development started with the simpler component: the Dear ImGui user interface. This allowed the core systems like the swap chain and device manager to be built and tested before moving to the more complex 3D scene renderer.
9:41 - Quirk #1: Confusing Binding Offsets: A major technical hurdle with NV-RHI was its system of applying hardcoded offsets to resource binding points (e.g., samplers start at binding 128, constant buffers at 256). This is done to map DirectX's resource-specific registers to Vulkan's unified system but caused significant issues with shaders, requiring a temporary workaround.
16:36 - Quirk #2: Solving a Major Memory Leak: A severe memory leak (300-400 MB/s) was traced back to neglecting to call NV-RHI's runGarbageCollection() function each frame. This function is critical for recycling command buffers and preventing constant, costly memory allocations.
20:05 - New Custom ImGui Renderer: Hazel no longer uses the example backend files from the Dear ImGui library. It now features a completely custom renderer, which gives finer control and integrates multi-viewport window creation and rendering directly into Hazel's own engine code.
23:01 - The Importance of GPU Drivers: The developer experienced severe system freezes when using UI features, which were completely resolved by updating the NVIDIA GPU drivers from the "Studio" to the "Game Ready" version.
23:58 - The Foundation is Laid: While the current visuals are simple, the core rendering pipeline is now fully functional. Systems for creating render passes, managing resources, and submitting draw calls are working, providing the foundation needed to build out the full 3D scene renderer.