Shadow Mapping (Tech Demo)

This project was undertaken as part of my Final Year Project at University, and was my first foray into using shaders with DirectX rather than the Fixed Function Pipeline. The aim of the application produced was to showcase shadow mapping in real-time using animated objects and an animated light, in addition to some of the methods which could be used to overcome inherent aliasing issues with shadow mapping. A number of methods to texture a terrain were also investigated, with the method of using a detail texture mask (the intensity of the RGB channels of the mask texture relate to individual tileable terrain textures) as used in Battlefield 2 being implemented in the application.

Features and Techniques

  • Detail texture mask with tileable textures for terrain
  • Allows the user to toggle the size of the shadow map used (512x512, 1024x1024, 2048x2048 and 4096x4096)
  • Hard shadows
  • Soft shadows using percentage-closer filter (3x3 or 5x5 kernal size)
  • Soft shadows using 3x3 percentage-closer filtering combined with a screen-space gaussian blur
  • Animated light source (sun)
  • Anmiated objects (can be toggled on / off)
  • Shadows can be toggled on / off

Screenshots

Click an image to enlarge (opens a new window).

image image image

Video

Download

Please download the demo here. Controls are included in a text file within the download.

Requirements

  • Shader Model 3.0 or greater capable graphics card.
  • March 2008 or later version of DirectX 9.0 re-distributable. Download the latest version here.
  • Built using Microsoft Visual C++ 2008 SP1 and requires the latest Microsoft Visual C++ Library Runtimes. The latest runtimes for the x86 platform can be downloaded here.