"Not since government devoted itself to race biology have such an extreme ideology been deemed clean. But now the racism has returned. Back then niggers were stupid, vagrants were dirty, gypsies were thieves and jews were greedy. Now it is men that are guilty. Only by being men."
- Johan Hakelius, Aftonbladet

Framework 4 (Last updated: October 25, 2019)
Framework 3 (Last updated: February 6, 2017)
Framework 2 (Last updated: October 8, 2006)
Framework (Last updated: October 8, 2006)
Libraries (Last updated: September 16, 2004)
Really old framework (Last updated: September 16, 2004)
Transparent shadowmapping
Thursday, October 9, 2003 | Permalink

Source code
TransparentShadowMapping.zip (1.2 MB)

Pixel shader 2.0
Vertex shader 2.0
Normally shadowmapping uses only a single channel of the texture the scene is rendered to. Using that depth you can extract information about whether the current fragment is in shadow or not. However, this only works for opaque occluders. This demo extends the idea to work for transparent surfaces too, and makes transparent surfaces cast a projection of itself over the scene. To do this not only the depth is rendered to the texture, but also a color. Opaque surfaces renders white along with the depth, while transparent surface renders its color and leaves the depth unmodified. Then by simply multiplying the shadow factor contructed in a normal shadowmapping fashion with the color stored in the shadow map you'll get a nice projection of transparent surfaces over the scene.

The demo should works on Radeon 9500 and up and the GeForce FX.