r_shadows is now ignored when in r_shadow_realtime mode
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 22 Nov 2002 12:43:30 +0000 (12:43 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Fri, 22 Nov 2002 12:43:30 +0000 (12:43 +0000)
r_shadow_realtime 3 added (no depth test on visible shadow volumes)
visible shadow volumes now have backface culling disabled, to better demonstrate the overdraw

git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2645 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 2cf04863e6cbdecd53e65c1ee7a3a2d3743feade..490568bb07b0d2b6dcc35b5310e62a2c457b683d 100644 (file)
@@ -824,7 +824,10 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                memset(&m, 0, sizeof(m));
                m.blendfunc1 = GL_ONE;
                m.blendfunc2 = GL_ONE;
+               if (r_shadow_realtime.integer >= 3)
+                       m.depthdisable = true;
                R_Mesh_State(&m);
+               qglDisable(GL_CULL_FACE);
                GL_Color(0.0 * r_colorscale, 0.0125 * r_colorscale, 0.1 * r_colorscale, 1);
        }
        else
@@ -1066,6 +1069,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
 
        if (!visiblevolumes)
                R_Shadow_Stage_End();
+       qglEnable(GL_CULL_FACE);
        qglDisable(GL_SCISSOR_TEST);
 }
 
@@ -1239,7 +1243,7 @@ void R_RenderView (void)
        R_DrawModels(r_shadow_lightingmode > 0);
        R_TimeReport("models");
 
-       if (r_shadows.integer == 1)
+       if (r_shadows.integer == 1 && r_shadow_lightingmode <= 0)
        {
                R_DrawFakeShadows();
                R_TimeReport("fakeshadow");
@@ -1271,7 +1275,7 @@ void R_RenderView (void)
 
        R_MeshQueue_Render();
        R_MeshQueue_EndScene();
-       if (r_shadow_realtime.integer == 2)
+       if (r_shadow_realtime.integer >= 2)
        {
                R_ShadowVolumeLighting(true);
                R_TimeReport("shadowvolume");