Game Programmer Portfolio

  Comparison of Shadow Mapping Algorithms  
 
I developed a demo of shadow maps for my fourth-term directed focus study at the Guildhall. I researched, implemented, and compared three separate shadow mapping algorithms involving various spatial and filtering methods. In addition to standard shadow maps, I implemented trapezoidal shadow maps for improved spatial accuracy and variance shadow maps to facilitate Gaussian blurring for soft shadows.

Initially, I planned to implement perspective shadow maps instead of trapezoidal shadow maps.  However, I found this technique to be poorly documented, and after spending several days struggling with it, I chose to implement trapezoidal shadow maps instead, as it was not only well-documented, but also supposedly a better technique with fewer problem cases to be resolved.

An unexpected and unfortunate result of combining trapezoidal and variance shadow maps can be seen to a degree in the screenshots below, and becomes very apparent in scenes with a dynamic camera.  Because the blur effect is performed in texture space, the perceived amount of blur changes depending on the camera's position, orientation, and field-of-vision relative to the light source.  This is not an issue with standard shadow maps because it simply means that shadows further from the light source will appear to have blurrier edges, which is actually a desirable effect.

Another problem I discovered with the variance shadow mapping technique is that, even when blurred, the shadows will never exceed their initial silhouettes.  This means that the blurring effect can only go "inwards" from the silhouette edges, which can make the shadow appear too skinny or make it disappear completely depending on the size of the object casting it.

This directed focus study was presented at the Guildhall Summer Exhibition on June 16, 2006.


Click thumbnails for full-sized screenshots
 
     
Copyright © 2005-2007 J. Kyle Pittman and The Guildhall at SMU.  All rights reserved.