The journey to integrate AMD's Stochastic Screen-Space Reflections (SSSR) into the Hazel engine was both challenging and rewarding. Initially, Hazel did not support HLSL shaders, which are crucial for AMD's SSSR. Recognizing the potential of HLSL, I integrated it into Hazel, even though Hazel primarily supports Vulkan. This was a significant step that required a deep understanding of both the Hazel engine and the Vulkan API. The integration of SSSR was further facilitated by the prior implementation of Screen Space Reflections (SSR), as both require a Hierarchical Depth Buffer. Thus, the path was paved for SSSR, making its integration much smoother and more efficient.
SSSR, also known as Stochastic Screen-Space Reflections, is a state-of-the-art screen space algorithm. To optimize the rendering process, I decided to remove the stochastic part of SSSR due to its excessive noise and less-than-ideal results in the AMD demo. Instead, I opted for cone tracing which was recommended by Cherno to allow for rough reflections. The color buffer is preconvoluted into mips, the mip to sample is decided based on the distance and roughness of the surface being shaded, utilizing the cone tracing algorithm, providing a more realistic and visually pleasing result. You can learn more about SSSR and its implementation from the official repository.
The integration of SSSR into the Hazel engine had a significant impact. It outperformed other algorithms that I had implemeted before, including SSR without a Hierarchical Z-Buffer, which I had incorporated in my early work in Beyond (my university final year project). The performance optimization from the Hierarchical Z-Buffer (HZB) was particularly impressive, especially considering the limitations of the previous implementations. Also, compared to AMD's stochastic algorithm was again, too noisy and
Temporal Anti-Aliasing (TAA) works well with SSSR, and it's an area where performance can be improved without sacrificing too much quality. I also plan to implement ray traced reflections, and perhaps even a hybrid of both ray traced reflections and SSSR. You can learn more about hybrid reflections from here.
In conclusion, the integration of SSSR into the Hazel engine has been a resounding success. It has not only improved the realism and flexibility of the engine but has also paved the way for future enhancements. The experience and knowledge gained from this project have been invaluable and will undoubtedly be beneficial in my future endeavors. As I continue to explore and implement new features.
Here are some images that demonstrate the results of my SSR implementation.
Click on an image to view it in bigger size.