Basic Shadow Mapping

Shadow Mapping | Thursday 23 October 2008 1:28 am

Shadow mapping works in that it checks if a point is visible from the light or not. If a point is visible from the light then it’s obviously not in shadow, otherwise it is. The basic shadow mapping algorithm can be described as short as this:

  1. Render the scene from the lights view and store the depths as shadow map
  2. Render the scene from the camera and compare the depths, if the current fragments depth is greater than the shadow depth then the fragment is in shadow
Shadow mapping example

It’s the implementation of it that is hard.

The two big problem areas with shadow mapping:

  • Hard to select an appropriate bias (epsilon)
  • Hard to get rid of artifacts at shadow edges

Projective texturing ( the method used to transform the fragment depth to the light space (where the shadow map is) for comparision)
http://developer.nvidia.com/object/Projective_Texture_Mapping.html
http://en.wikipedia.org/wiki/Projective_texture_mapping

OpenGL fixed-function pipeline implementation of shadow mapping:
http://www.paulsprojects.net/tutorials/smt/smt.html

A GLSL implementation of shadow mapping (in one of the posts)
http://www.gamedev.net/community/forums/topic.asp?topic_id=316147

Another GLSL shadow mapping shader:
http://sombermoon.com/shadowmappingdoc.html

DirectX9 shadow mapping example with source
http://msdn.microsoft.com/en-us/library/bb147372(VS.85).aspx

Nvidias implementation of shadow mapping with source for both OpenGL and DirectX.
http://developer.nvidia.com/object/hwshadowmap_paper.html

Shadow mapping in XNA
http://www.riemers.net/eng/Tutorials/DirectX/Csharp/Series3/Shadow_mapping.php
http://msdn.microsoft.com/en-us/library/bb975671.aspx

Please share:
  • Print this article!
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Current
  • LinkedIn
  • Live
  • MySpace
  • Netvibes
  • StumbleUpon
  • Twitter
  • Reddit
  • Technorati
  • Yahoo! Bookmarks

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment