Real-Time Graphics: Deferred Renderer

This project is a renderer written in C++ using Direct3D10, using HLSL shaders to perfom GPU side graphical computations. The project uses deferred rendering techniques combined with Screen Space Ambient Occlusion (SSAO) and FXAA for antialiasing to produce a scene with many moving lights, all running at 60+ FPS.

Prior to this project I had experience with Direct3D9 and HLSL, so had a knowledge of graphics pipelines etc. but as D3D10 is quite a bit different there was quite a bit to learn, along with learning the techniques for deferred rendering, SSAO and anti-aliasing.

The renderer involved multiple passes through the graphics pipeline, in order to implement the deferred rendering technique and the SSAO and anti-aliasing. The first pass fills up screen space buffers with information like the normals and positions for each pixel in the final render target. This information is then used to calculate the SSAO component in a seperate render tartget. This is then blurred in x then y using two passes. The lighting is then calculated using the previous buffers and the final image is composited. The anti-aliasing technique FXAA is then run on this final image in its own pass, to reduce the aliasing.

Final image with SSAO:

One of the main components to this project was the Screen Space Ambient Occlusion, which attempts to emulate soft shadowing from ambient lighting in a scene, but doing all the calculations based in screen space, so no matter how complex the scene gets the SSAO will always require the same amount of processing.

Final image with no SSAO:

 

SSAO only:

 

Blurring the results from the SSAO calculations allows for a smoother result that blends in better with the scene and seems more natural.

SSAO after blurring:

 

Anti-aliasing is applied to attempt to get rid of any jagged edges that may be present. The technique used does not get rid of all aliased edges but it does make a noticable improvement to the image.

Image with no anti-aliasing:

Final image with some visual debugging data:

I also added functionality to display the buffers from the first pass, to test during development, as well as using the D3D10 Queries to query the time taken for each pass, allowing for bottlenecks in the application to be identified and optimisations to be made.