Shadow Mapping Techniques

CSC 472 Final Project - Christopher Gibson

Premise:

The focus of this project is to learn more about depth buffers and their role in hardware-accelerated shadows as well as the various techniques used in shadow mapping. Frame Buffer Objects were also involved, and different techniques at building, handling and utilizing FBOs were also researched in order to handle the depth buffers gathered from the light source.

Technology:

Techniques:

Hardware-accelerated Shadows:
An FBO is constructed to take in the depth values from the perspective of the light. Once the scene is rendered from the camera's view, the depth texture is passed into a shader during the regular render phase. Utilizing shadow2DProj to project the depth value using a stored light matrix, the GPU returns whether or not the current point is in shadow.

Dither/Soft Shadows:
In order to 'soften' the edges of the shadows being cast, we must look past the current point being drawn and check surruonding points in the light's depth buffer. Averageing the results we get helps us determine how dark or light to make the pixel, causing a blurred effect on the shadow's silhouette. Dithered shadows are done similarly, modulating using the fragment's x and y values to offset the test points.

Projected Textures:
Projected textures are done similarly to the shadow projections, the current vertex is multiplied by the stored light matrix, and a texel from the texture is grabbed using texture2Dproj, literally 'projecting' the texture into space.

Application:

Controls: Known Bugs:
Code References:

References:

http://www.cescg.org/CESCG-2009/papers/VUT-Schwaerzler-Michael.pdf

http://fabiensanglard.net/shadowmappingPCF/index.php

PCSS Reference:

http://http.download.nvidia.com/developer/presentations/2005/SIGGRAPH/Percentage_Closer_Soft_Shadows.pdf

http://developer.download.nvidia.com/shaderlibrary/docs/shadow_PCSS.pdf