Summary

This is a graphics framework I created to experiment and add advanced rendering techniques like deferred shading, soft shadows, ambient occlusion, etc. It was developed in C++ over the period of 4 months, from January to April 2023.

Take a look at the code: github.com/aseemapastamb/cs562-ao

Contributions

  • Created a performant renderer using deferred shading, allowing for a significant number of local light sources
  • Implemented Variance and Moments Algorithms for soft shadowing, improving visual depth and fidelity
  • Combined physically-based shading and image-based lighting, including global tone mapping and colour space conversion of values from HDR images, providing a more realistic appearance
  • Further improved visual fidelity by including ambient occlusion, which adds contact shadows and darkened edges

Project Snippets

This framework has deferred shading. This means that there are 2 rendering passes. In the first pass, the geometrical information from the objects in the scene is collected. This information is stored in a collection of textures called the G-Buffer, to be used in the second pass, which involves the heavy lighting calculations. This means that the complex lighting calculations are done only for the pixels that are visible from the eye position, i.e., the front-most pixels.

Here is the G-Buffer for the scene.

The first texture is the position of objects.

The second texture is surface normals.

The third texture is the diffuse colours of the materials.

The fourth texture is the specular colours of the materials.

The main advantage of deferred shading is that it enables us to have a large number of light sources. Here are some blue local lights in the scene.
We can see the lights more clearly if we turn on the range of influence of each light.
I also added soft shadows using blurred shadow maps. I used a method called Moment Shadow Maps to achieve this. This was also an opportunity for me to learn and implement compute shaders, which I used to blur the shadow map.
Here is an intermediate step while creating the blurred shadow map. The process of blurring involves 2 passes - horizontal blur and vertical blur. This is the output of the horizontal blur.