summaryrefslogtreecommitdiff
path: root/src/renderergl2/tr_shadows.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/renderergl2/tr_shadows.c')
-rw-r--r--src/renderergl2/tr_shadows.c28
1 files changed, 7 insertions, 21 deletions
diff --git a/src/renderergl2/tr_shadows.c b/src/renderergl2/tr_shadows.c
index 72a07247..32110175 100644
--- a/src/renderergl2/tr_shadows.c
+++ b/src/renderergl2/tr_shadows.c
@@ -212,7 +212,6 @@ void RB_ShadowTessEnd( void ) {
// draw the silhouette edges
GL_Bind( tr.whiteImage );
- qglEnable( GL_CULL_FACE );
GL_State( GLS_SRCBLEND_ONE | GLS_DSTBLEND_ZERO );
qglColor3f( 0.2f, 0.2f, 0.2f );
@@ -223,28 +222,15 @@ void RB_ShadowTessEnd( void ) {
qglEnable( GL_STENCIL_TEST );
qglStencilFunc( GL_ALWAYS, 1, 255 );
- // mirrors have the culling order reversed
- if ( backEnd.viewParms.isMirror ) {
- qglCullFace( GL_FRONT );
- qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
+ GL_Cull( CT_BACK_SIDED );
+ qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
- R_RenderShadowEdges();
+ R_RenderShadowEdges();
- qglCullFace( GL_BACK );
- qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
+ GL_Cull( CT_FRONT_SIDED );
+ qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
- R_RenderShadowEdges();
- } else {
- qglCullFace( GL_BACK );
- qglStencilOp( GL_KEEP, GL_KEEP, GL_INCR );
-
- R_RenderShadowEdges();
-
- qglCullFace( GL_FRONT );
- qglStencilOp( GL_KEEP, GL_KEEP, GL_DECR );
-
- R_RenderShadowEdges();
- }
+ R_RenderShadowEdges();
// reenable writing to the color buffer
@@ -273,7 +259,7 @@ void RB_ShadowFinish( void ) {
qglStencilFunc( GL_NOTEQUAL, 0, 255 );
qglDisable (GL_CLIP_PLANE0);
- qglDisable (GL_CULL_FACE);
+ GL_Cull( CT_TWO_SIDED );
GL_Bind( tr.whiteImage );