Skip to content

Commit

Permalink
Carmack's reverse revert
Browse files Browse the repository at this point in the history
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
DanielMorsing committed Nov 30, 2011
1 parent 1559777 commit 1653276
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions neo/renderer/draw_common.cpp
Expand Up @@ -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
Expand Down

0 comments on commit 1653276

Please sign in to comment.