Skip to content

Instantly share code, notes, and snippets.

@slacka
Last active December 9, 2018 20:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slacka/7869586 to your computer and use it in GitHub Desktop.
Save slacka/7869586 to your computer and use it in GitHub Desktop.
Doom 3 Carmack's Reverse
https://github.com/tmek/DOOM-3-BFG-VR/commit/244d9cb2f43fbb6d0d5d0f2b6f568b09fbaf2e85
renderer/tr_backend_draw.cpp
@@ -34,7 +34,7 @@
34 34
idCVar r_drawEyeColor( "r_drawEyeColor", "0", CVAR_RENDERER | CVAR_BOOL, "Draw a colored box, red = left eye, blue = right eye, grey = non-stereo" );
35 35
idCVar r_motionBlur( "r_motionBlur", "0", CVAR_RENDERER | CVAR_INTEGER | CVAR_ARCHIVE, "1 - 5, log2 of the number of motion blur samples" );
36 36
idCVar r_forceZPassStencilShadows( "r_forceZPassStencilShadows", "0", CVAR_RENDERER | CVAR_BOOL, "force Z-pass rendering for performance testing" );
37
-idCVar r_useStencilShadowPreload( "r_useStencilShadowPreload", "1", CVAR_RENDERER | CVAR_BOOL, "use stencil shadow preload algorithm instead of Z-fail" );
37
+idCVar r_useStencilShadowPreload( "r_useStencilShadowPreload", "0", CVAR_RENDERER | CVAR_BOOL, "use stencil shadow preload algorithm instead of Z-fail" );
38 38
idCVar r_skipShaderPasses( "r_skipShaderPasses", "0", CVAR_RENDERER | CVAR_BOOL, "" );
39 39
idCVar r_skipInteractionFastPath( "r_skipInteractionFastPath", "1", CVAR_RENDERER | CVAR_BOOL, "" );
40 40
idCVar r_useLightStencilSelect( "r_useLightStencilSelect", "0", CVAR_RENDERER | CVAR_BOOL, "use stencil select pass" );
@@ -1462,6 +1462,9 @@ static void RB_StencilShadowPass( const drawSurf_t *drawSurfs, const viewLight_t
1462 1462
qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_INCR, GL_INCR );
1463 1463
} else {
1464 1464
// Z-fail
1465
+ // LEITH: warning this is patented by Creative Labs in US (software patents are bad)
1466
+ qglStencilOpSeparate( GL_FRONT, GL_KEEP, GL_DECR, GL_KEEP );
1467
+ qglStencilOpSeparate( GL_BACK, GL_KEEP, GL_INCR, GL_KEEP );
1465 1468
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment