Permalink
Browse files

Carmack's reverse revert

This gets rid of the workaround added because of the creative patent.
This also gets rid of 2 unneccesary draw calls per shadow volume.

Thanks for labeling the patent workaround with a comment, John :)

Signed-off-by: Daniel Morsing <daniel.morsing@gmail.com>
  • Loading branch information...
1 parent 1559777 commit 16532769d6eeebea83179adfec208cdec5c3b8f2 @DanielMorsing DanielMorsing committed Nov 24, 2011
Showing with 5 additions and 7 deletions.
  1. +5 −7 neo/renderer/draw_common.cpp
@@ -1143,16 +1143,14 @@ static void RB_T_Shadow( const drawSurf_t *surf ) {
return;
}
- // 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 );
+ qglStencilOp( GL_KEEP, tr.stencilIncr, GL_KEEP );
GL_Cull( CT_BACK_SIDED );
RB_DrawShadowElementsWithCounters( tri, numIndexes );
+ GL_Cull( CT_FRONT_SIDED );
+ qglStencilOp( GL_KEEP, tr.stencilDecr, GL_KEEP );
+ RB_DrawShadowElementsWithCounters( tri, numIndexes );
+ return;
}
// traditional depth-pass stencil shadows

0 comments on commit 1653276

Please sign in to comment.