Project

Godot hybrid ray-tracing

Modified Godot's Vulkan back-end to implement hardware-accelerated ray tracing, using a hybrid rendering approach for reflections.

🎮 Godot 🔧 C++ | Vulkan ⚡ Hardware Ray Tracing 👤 3 people 💻 PC ⏱️ 8 weeks

Overview

During my first block in year 3, I worked together with 2 other programmers to create a Hybrid ray tracing extension for Godot by modifying its source code. We based our branch on an already existing implementation from Antonio Caggiano. Below are my contributions to our own approach where we integrated the ray-tracing features into the engine’s source.

Github Repository: Godot ray tracing

Article with code and implementation details for the diffuse reflections:

Modifying Godot's Vulkan back-end to support hardware accelerated raytracing

Hybrid reflections in Godot engine’s Vulkan back-end

My contributions

Hybrid Ray-Traced Reflections

Implemented hybrid ray-traced reflections in Godot's forward+ renderer by skipping the main ray using rasterized G-buffer data and tracing secondary rays from reconstructed world positions.

Vulkan Ray Tracing Pipeline Integration

Helped integrating the Vulkan ray tracing pipeline into Godot's source including shader binding table setup, acceleration structure traversal, and descriptor set management for uniforms like the TLAS, render targets, and camera matrices.

Setting Up Ray Tracing Shaders

Built the raygen, closest-hit, and miss shaders in GLSL 460 with iterative reflection loops.

G-Buffer Data Reconstruction

Reconstructed world positions from the depth buffer and decoded view-space normals to world-space to use as ray origins and directions, this means we can skip the primary ray bounce.

Modified Godot Shader Builder

Extended Godot's Python-based shader builder to support all the ray tracing shader stages, also made it match Godot's system to nullptr the unused shaders.

Debugging with NSight & RenderDoc

Used NVIDIA NSight to validate TLAS/BLAS data and shader binding table layout, and RenderDoc to capture and analyze the forward+ render loop draw order and resource usage with Godot's unique Resource ID system.