top of page
EndOfHallway.png

Hybrid Reflections

The aim of this project was to create a hybrid reflection method which combined SSR and Ray Tracing. The solution was implemented using the Vulkan API and written in C++.

​

The source code and report can be found here:  dtocomerford/Dissertation

Implementation

Here is an overview of the project's implementation. I cover the render loop structure, the composition of the hybrid reflection solution and the reflection effects present in this project.

 

The render loop includes multiple render passes, initially a geometry pass is performed which populates the G-Buffer. The next pass is where the screen space reflections are executed on reflective surfaces. Pixels which fail to be resolved by SSR are flagged and passed to the next stage of the render loop which is the Ray Tracing step. Rays are generated for each failed pixel from the world position of the reflective object, this step infills the reflective surface and improves the quality of SSR. the figure below depicts the stages of the render loop.

PipelinesAndRenderPasses.png

The screenshot below shows the ratio of SSR pixels (Pink) and Ray Traced pixels (Green). SSR fails when reflective rays leave screen space. This can be seen below in the reflection of the underside of the archway at the end of the palace, and large square area in the middle of the floor which would be a reflection of the sky.

GoodComparisonColorMappedBrighterLarger.png

Once both of the reflective steps are complete there is a post processing step which applies Gaussian blur to the reflective portion of the image. This is applied by deploying compute shaders which perform the image processing. The Gaussian blur is added to give a smoother finish to the reflective pixels which can be noisy. The blur is applied to the reflective pixels in the below image where SSR is on and Ray Tracing is off.

blur.png

Aside from blur there are a couple of effects which I implemented. The Fresnel effect being one of them. I computed the portion of reflected light using Schlick's approximation and blended the reflective contribution with the surface's base colour. This effect can be seen in the screenshot below.

Position4.png

I also implemented glossy reflections by adding a random epsilon to the reflection rays leaving the surface. When implementing glossy reflections noise is a common unwanted addition to the image, this noise can be reduced by blurring. In the screenshot below glossy reflections are enabled with Gaussian blur switched off.

glossyLarger.png

For a deeper dive into the project feel free to read the full report here: dtocomerford/Dissertation

bottom of page