some more minor cleanups
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Apr 2003 05:31:37 +0000 (05:31 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 7 Apr 2003 05:31:37 +0000 (05:31 +0000)
bug with dlights when not using stencil has not been found yet

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

gl_rmain.c
r_shadow.c

index 0ce87d3..79ee2ea 100644 (file)
@@ -954,9 +954,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                                        {
                                                ent = r_refdef.entities[i];
                                                if (ent->visframe == r_framecount && ent->model && ent->model->DrawLight
-                                                && ent->maxs[0] >= clipmins[0] && ent->mins[0] <= clipmaxs[0]
-                                                && ent->maxs[1] >= clipmins[1] && ent->mins[1] <= clipmaxs[1]
-                                                && ent->maxs[2] >= clipmins[2] && ent->mins[2] <= clipmaxs[2]
+                                                && BoxesOverlap(ent->mins, ent->maxs, clipmins, clipmaxs)
                                                 && !(ent->effects & EF_ADDITIVE) && ent->alpha == 1)
                                                {
                                                        Matrix4x4_Transform(&ent->inversematrix, wl->origin, relativelightorigin);
@@ -982,11 +980,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                        clipmaxs[0] = rd->origin[0] + lightradius;
                        clipmaxs[1] = rd->origin[1] + lightradius;
                        clipmaxs[2] = rd->origin[2] + lightradius;
-                       if (VIS_CullBox(clipmins, clipmaxs))
-                               continue;
-
-                       //if (R_Shadow_ScissorForBBoxAndSphere(clipmins, clipmaxs, rd->origin, cullradius))
-                       if (R_Shadow_ScissorForBBox(clipmins, clipmaxs))
+                       if (VIS_CullBox(clipmins, clipmaxs) || R_Shadow_ScissorForBBox(clipmins, clipmaxs))
                                continue;
 
                        cullradius = RadiusFromBoundsAndOrigin(clipmins, clipmaxs, rd->origin);
@@ -1045,9 +1039,7 @@ void R_ShadowVolumeLighting (int visiblevolumes)
                                        {
                                                ent = r_refdef.entities[i];
                                                if (ent->visframe == r_framecount && ent->model && ent->model->DrawLight
-                                                && ent->maxs[0] >= clipmins[0] && ent->mins[0] <= clipmaxs[0]
-                                                && ent->maxs[1] >= clipmins[1] && ent->mins[1] <= clipmaxs[1]
-                                                && ent->maxs[2] >= clipmins[2] && ent->mins[2] <= clipmaxs[2]
+                                                && BoxesOverlap(ent->mins, ent->maxs, clipmins, clipmaxs)
                                                 && !(ent->effects & EF_ADDITIVE) && ent->alpha == 1)
                                                {
                                                        Matrix4x4_Transform(&ent->inversematrix, rd->origin, relativelightorigin);
index 9fae3b8..84a1484 100644 (file)
@@ -838,8 +838,7 @@ int R_Shadow_ScissorForBBox(const float *mins, const float *maxs)
        if (DotProduct(vpn, v2) <= f)
        {
                // entirely behind nearclip plane
-               qglDisable(GL_SCISSOR_TEST);
-               return false;
+               return true;
        }
        if (DotProduct(vpn, v) >= f)
        {