D5 GI | Pursuing offline rendering quality with real-time experience

01 Preface

1.1 What is GI?

Designers often strive to create realistic renderings, which look so real that many will mistake them for photos. On the one hand, detailed modeling contributes to realism; on the other hand, an advanced rendering software that can accurately simulate the light and materials in the real world will take your rendering up a notch.
Photorealistic rendering by D5 Render
The technique used in computer graphics to replicate actual lighting interactions is called Global Illumination (GI). GI considers not only the direct lighting from a light source on an object, but also the indirect lighting that reaches the object's surface after multiple bounces.
In the real world, after reflecting off surfaces, light will continue to bounce until its energy is exhausted. It is important to simulate this physical phenomenon if we want more realistic renderings. While algorithms for direct lighting are already well-developed, the implementation of indirect lighting, particularly diffuse indirect lighting, still remains a challenge.
In conclusion, GI aims to solve the problem of light bouncing in the scene twice and afterwards, which can bring better brightness and detail to the parts that are not illuminated by direct lighting. It plays a crucial role in creating photorealistic renderings that can trick the human eye.

1.2 Why real-time GI?

Since GI is so important, how to implement it has become a common technical issue in the rendering industry. In recent decades, many solutions have been proposed, including the well-known ray tracing, in order to solve this problem perfectly. GI in real-time rendering is even more challenging due to limited time.
Offline rendering: It allows algorithms to spend a significant amount of time solving the indirect lighting of a scene and producing high-quality results. Images in an animated movie, for example, require hundreds of hours of offline computation.
Real-time rendering: It has to render at least 30 frames per second, namely one frame within 0.03 seconds.
As a result, achieving real-time GI is a cutting-edge topic in the industry and a measure of technical ability. D5 Render, a real-time rendering tool, must also grapple with this challenge.
The real-time rendering promoted by D5 can respond quickly to the designer's actions and translate them into high-quality images, allowing users to immediately see the visual rendering of their ideas without waiting for the process to complete.
Bearing the goal of achieving real-time GI in mind, the D5 Team has managed to overcome challenges and developed D5 GI to ensure both quality and speed.

02 The logic behind D5 GI

2.1 Previous solutions

The rendering equation, proposed by Kajiya, is the foundation for Global Illumination algorithms. It accurately describes the way light travels through a scene based on the physics of light and the law of conservation of energy. Therefore, implementing Global Illumination is essentially finding a solution to the rendering equation, which is very complex. The limit of time (less than 0.03s) in real-time rendering adds more trouble to the process.
Previous real-time GI solutions have issues including light leakage, excessive occlusion and a lot of noise due to inadequate sampling rates.
Light leakage between the wall and the ceiling
Too much noise in the image
Yet the D5 Team was not deterred by these problems and developed a more advanced real-time GI technique called ReSTIR Surfel GI. This solution significantly improves the image quality while still ensuring the speed of real-time rendering.

2.2 ReSTIR Surfel GI

2.2.1 ReSTIR GI
ReSTIR (Reservoir-based Spatio Temporal Importance Resampling) is a set of algorithms that leverages the temporal and spatial reuse of samples to efficiently handle the problem of sampling multiple light sources. This approach was originally presented in a SIGGRAPH paper by Bitterli et al. in 2020.
D5 uses ReSTIR on GI to store the paths of rays rather than sampling light sources. ReSTIR GI reduces the variance of the sampling results by reusing sample information between frames and between neighboring pixels, allowing it to achieve high-quality results even when there're only a small number of samples.
ReSTIR off
However, the reuse of temporal samples can also cause Temporal Lag when the light source changes or when dynamic objects are present. To address this issue, D5 uses Path Validation to detect changes in brightness between the previous and current frame and adjusts the number of samples to be reused accordingly.
2.2.2 Surfel GI
ReSTIR, despite its good results, is difficult to use in multiple bounce calculations for real-time rendering. Therefore, the D5 GI system applied a Surfel Caching solution for subsequent bounce calculations.
Surfel is a spatial caching technique that can be iteratively generated based on screen space and efficiently accumulate and cache irradiance, allowing GI rays to simply query the lighting results for subsequent bounces. However, this solution introduces some new problems, such as being unable to obtain results outside of the screen space.
The reflections far away seem too dark
To address this issue, D5 made improvements to the Surfel Caching solution. It generates Surfel from the intersection of the ray emitted by GBuffer, storing the Surfel of the location outside the view and thus obtaining the correct result.
Surfel GI
The improved Surfel GI by D5
Besides, the scene is divided into cascading Grids to manage Surfels and thus reduce VRAM usage. Light leakage is solved by sorting and comparing the times of ray bounces. Other artifacts are also improved.
2.2.3 Other optimisations
The D5 Team has also developed a series of solutions for multiple light source sampling, reflection, and denoise, allowing the ReSTIR Surfel GI to function efficiently and reliably in various scenarios.

03 Performance of D5 GI

3.1 D5 GI versus Path Tracing

To assess the performance of the D5 GI, we can compare it to Path Tracing, which is commonly known as the standard of computer rendering.
You can see from the two following images that the result of D5 GI is very close to that of Path Tracing. It means that the D5 GI strikes a great balance between speed and quality.
Path Tracing
D5 ReSTIR Surfel GI  

3.2 D5 GI Upgrade

3.2.1 Space with Great Depth
The earlier versions of D5 GI didn't consider skylight during the caching, so interior scenes often seem dark and unnatural.  
The updated D5 2.4 GI now counts the skylight in, bringing realistic lighting even in spaces with great depth. This will greatly improve the realism of the interior lighting effect.
The part behind the wall is better lit up
3.2.2 High-Frequency Shadow Detail
The previous D5 versions pursued strong denoising effects, thus making the image look a bit flat. The new D5 GI employs NVIDIA's real-time denoiser and leverages low variance samples provided by Restir sampling to offer more high-frequency shadow detail, so the scene looks more realistic.
Clearer shadows and details
3.2.3 GI Precision
The new D5 GI supports high precision indirect lighting caching, ensuring subtle and realistic transition from light to dark.
Subtler transition and richer grey part
3.2.4 Plant
In the real world, the leaves will look semi-transparent when light shines through. The new D5 GI and sky light will better simulate this effect.
3.2.5 Emissive
Previous D5 versions only calculate direct lighting of emissive materials. So, they cannot be used as the main light source. Otherwise, the scene would look too dark.  
Yet the D5 2.4 GI has fixed this issue by calculating the light bounces, giving the emissive materials better performance.
When emissive is used as the main light source
3.2.6 Preview, Rendering, and Animation
D5 users will no longer meet the brightness difference between preview and render caused by the use of different solutions in previous D5 versions. The new D5 GI ensures a much more precise preview, offering smooth creation experience.
The preview is the same as the render

04 Summary

In essence, we made all these efforts to ensure that designers could instantly visualize their ideas with no need to wait. D5 Render builds a streamlined workflow through the gorgeous GI effect, the precise preview and the fast rendering speed.
High-quality GI requires ongoing optimization. Therefore, the D5 Team will keep making progress to achieve offline rendering quality when offering real-time experience.