I wonder why the depth fail shadow rendering algorithm had been explicitly excluded from the open source release. It's been around for years now, after all.
Check out draw_common.cpp [2] - the patent work-around is contained in the RB_T_Shadow method:
// patent-free work around
if ( !external ) {
// "preload" the stencil buffer with the number of volumes
// that get clipped by the near or far clip plane
qglStencilOp( GL_KEEP, tr.stencilDecr, tr.stencilDecr );
GL_Cull( CT_FRONT_SIDED );
RB_DrawShadowElementsWithCounters( tri, numIndexes );
qglStencilOp( GL_KEEP, tr.stencilIncr, tr.stencilIncr );
GL_Cull( CT_BACK_SIDED );
RB_DrawShadowElementsWithCounters( tri, numIndexes );
}
[1] See my previous comment for more info: http://news.ycombinator.com/item?id=2945889[2] https://github.com/TTimo/doom3.gpl/blob/master/neo/renderer/...
Edit: OK. I just googled and it indeed is Carmack's reverse.