1- Complete implementation of ReSTIR-GI:
As with the previous update, I partially implemented the spatial part of ReSTIR-GI. With this update, the temporal dimension is also implemented; Resulting in a more accurate image with a better performance.
A full implementation leverages the data already processed in previous frames to help find the best samples. Unlike the spatial dimension, it needs to sample the temporal reservoir history buffer just once. But as the buffer accumulates over time, that single sample can do the work of much more spatial reservoir samples. This, besides not needing to do 2 ray tracing passes for every pixel helps a lot with performance. Besides that, as there is no spatial bias in temporal reservoirs, they tend to be more accurate.
On the other, with all the benefits of temporal reservoirs over the spatial ones, there's still a need for the latter. Temporal reservoirs fail to find the best path when there's disocclusion, and this is where the spatial ones shine.
2- Massive performance boost using temporal upscaling:
Previously, only the main ray tracing pass would be upscaled, while the denoising passes were in full resolution, to help upscale the RT pass results. But now that I created a temporal upscaler for CompleteRT, I could feel free to reduce their resolution as well; so now, when you decrease the resolution of the shader, you can feel much more difference in the performance than before.
Meanwhile, this new upscaling technique will make you feel less blurriness in the image than before. Temporal upscaling uses the data from previous frames to increase the fidelity. While the bilateral upscaling used in the previous versions could only keep the edges sharp, temporal upscaling can also help with the lighting details.
On another note, changing the value of the resolution scale is easier now as thanks to the new algorithm, it is possible to change in runtime rather than using a preprocessor setting.
3- Sky Light Fallback:
A new feature, for diffuse illumination, which I call Sky Lighting, is now available to enjoy. This new feature helps you apply the color of the sky to the surroundings even if the sky itself is not visible on the screen. It can automatically detect the color of the sky; however, it is fully customizable and you can change the tint, disable the automatic color detection, and tune the intensity to your favor.
Sky Lighting is internally used as a fallback for when the ray tracer doesn't hit anything. This helps minimize the bias while keeping the aesthetics in your favor. It also helps reduce the noise and make the details of the lighting more clear.
Sometimes you want to decrease the ray length; maybe to increase the precision while keeping the shader performant. In such cases, rays can no longer reach the sky so you might lose the sky color on the ground, trees, buildings, and whatnot. In such cases, this Sky Lighting is a helpful feature.
In another case, you might want to keep the ray length high, but there might still be other reasons to use Sky Lighting. For example, as the shader currently works in screen space, you might experience problems with the sunshine appearing and disappearing when you move the camera up and down. For such scenarios, I introduced Lightmap masking in previous updates, so you could mask the sky or the sun. But masking them out, while fixing the said problem, will leave the whole unaffected by the big soft-box area light that is our sky. Now with this new update, you can bring back the sky lighting even if it's off-screen.