Image-Space Soft Shadows:
Adam Pawlowski
References Papers:
http://www.gamedev.net/reference/articles/article2193.asp
http://developer.download.nvidia.com/presentations/2008/GDC/GDC08_SoftShadowMapping.pdf


Dropship model by Todd Kumpf.


Background:

Shadow Mapping is the most highly used way of producing real-time shadows and is also highly prone to aliasing. There are many algorithms to produce anti-aliasing shadows. The algroithm used here is in screen-space, therefore, it will always produce soft edges regardless of:
1.) shadow map size, or
2.) the distance from the light to the viewer.

The 2 pictures below show what can be achieved with the two problems described above (a low-res shadow map, and a huge distance between the viewer and light source).

Left: No sampling Right: 12 samples.

**In this example, the shadow map is in such low resolution that it cannot capture some of the finer details of the dropship (such as the fins). This causes the final image to have an un-natural shape, but both the regular and soft shadowed versions have this problem with details, but the soft-shadowed image looks incredibly better.


The Algorithm:


As you can see, combing PCF with the Image-Space blur is pointless. It achieves an almost exact result.
The algorithm requires you to render the scenes shadows seperate from the colors. The algorithm is:
1.) Generate the shadow map from the light.
2.) Draw the projected shadow map only.
3.) Blur the projected shadow map.
4.) Draw the scene as you would, combining it with the blurred shadow texture.
*To save drawing the scene three times, you should attach two FBO's to the shader. This way you can draw the projected shadow map to one buffer and the normal lit scene into another buffer. Finally you can combine both of these images together, without rendering all of the scenes geometry again.

(click thumnails for larger view)

Left: The Depth Buffer: Perspective, 800x600 (low-res) Right: No sampling



Left: 4 Samples. Right: 8 samples. Bottom: 12 samples.