Light Space Perspective Shadow Maps

Posted: March 4, 2012 in INFR 2350
Tags: , , , , , ,

There are several different techniques for shadow mapping in applications. Each one has advantages and disadvantages unique to those techniques, therefore some techniques are more suitable to an application more so than others. Today we will be talking about Light Space Perspective Shadow Maps (LiSPSM) in a general respect. This technique is under the category of Warping shadow mapping techniques.


This technique is based upon the shadow mapping algorithm by Williams. A major problem with Standard Shadow Mapping (SSM) is the artifacts that are created by perspective aliasing. LiSPSM’s goal is to try to minimize and decrease the amount of artifacts by using perspective transformations suitable to certain situations, which creates a better looking shadow map.

What is Standard Shadow Mapping?

Since LiSPSM is based upon SSM, it is only natural to give a brief idea on what SSM is. This technique uses a two pass algorithm, where in the first pass the scene is viewed from the point of view of the light source and a two dimensional depth test image is saved from that view (basic shadow map).

Example of a depth image.

During the second pass of the algorithm, the scene is rendered from the point of view of the observer. As the render draws each pixel, it is transformed into the light source space and tested for visibility to the light source.

If that pixel is not visible by the light source, it is a shadow and the shading on that pixel will be changed accordingly. SSM is the basis for many shadow mapping techniques.

The yellow arrow represents a light source while the red sphere represents the observer and the point of view. 

SSM sounds pretty good and sufficient enough, why make it beter?

SSM creates aliasing problems when objects near the viewer get insufficient shadow map resolution. Far objects look good, while close objects get artifacts in their shadows.

Left diagram shows exaggerated effectiveness of SSM in relation to light source and observer. Right image shows artifacts created in a render.

Okay, so LiSPSM makes SSM better?

LisSPSM is not solely based upon SSM. Another technique that influences LiSPSM is Perspective Shadow Mapping (PSM). In PSM, you transform the post perspective space of the observer (perspective matrix * modelview matrix) and apply light source transformations on the matrix. Depending on where the observer is, the transformation will be different. This technique reduces perspective aliasing (far objects get smaller, closer objects get bigger).

The problems of PSM are:

  • Shadows from behind require a virtual move back of the camera because of the singularity of the perspective transformation
  • Lights can change the type of shadow (point/direction/inverted)
  • A lot of special cases
  • Non-intuitive post-perspective space
  • Shadow quality dependent upon view.
  • Uneven z-distribution

How does LiSPSM put SSM and PSM together and work?

Basically what LiSPSM does, based upon PSM, is use the perspective transformation based on the observers location. It specifies the perspective transformation in light space. This creates an additional frustum to the original view frustum.

The new frustum created, called P, has to enclose the original frustum, called B. Within the frustum B, it contains all interesting light rays, which is essentially all objects that can cast shadows. P is the perspective frustum where it is parallel to the shadow map.

In this diagram, P is the perspective frustum, B is the frustum containing interesting light, the orange yellow pointing downwards is the light source.

This technique will combine several matrices and essentially creates an equally spaced point cloud. What this is, is a cloud containing points which represent light rays available to hit an object. Through the LiSPSM technique, as the object gets closer, the cloud will become denser with the points coming closer to one another, and while it gets further, the points will disperse. This means more detail when closer and less detail when further.

The cloud on the left shows an equally spaced point cloud, consistent throughout, while the cloud on the right shows the transformed point set. 

These scenes show the effect of LiSPSM, where the top left shows the point of view of the light source. It gets closer/more direct to the fence moving to the right. 

This technique also contains directional lighting.

All the math goodness can be found on pages 3, 4 and 5 of


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s