I am sure there are several ways to do it. Tho it may be hard to find a GOOD one, a fast one.
http://www.gamasutra.com/features/19991115/bestimt_freitag_01.htm
http://www.caip.rutgers.edu/~kuttuva/shadow_volumes.html
http://en.wikipedia.org/wiki/Shadow_volume
http://www.gamedev.net/reference/articles/article1873.asp
http://downloads.gamedev.net/pdf/VolumeShadowsTutorial-2036.pdf
http://www.planetquake.com/q3empire/files/papers/Realtime_Shadowcasting.pdf
this one even has a link to a quake 1 modified engine that has stencil shadows in:
http://www.aceshardware.com/read_news.jsp?id=60000466
http://www.gamasutra.com/features/19991115/bestimt_freitag_01.htm
http://www.caip.rutgers.edu/~kuttuva/shadow_volumes.html
http://en.wikipedia.org/wiki/Shadow_volume
http://www.gamedev.net/reference/articles/article1873.asp
http://downloads.gamedev.net/pdf/VolumeShadowsTutorial-2036.pdf
http://www.planetquake.com/q3empire/files/papers/Realtime_Shadowcasting.pdf
this one even has a link to a quake 1 modified engine that has stencil shadows in:
http://www.aceshardware.com/read_news.jsp?id=60000466