From: havoc Date: Wed, 11 Sep 2002 01:19:39 +0000 (+0000) Subject: major speed gain in cavetest2 by checking if the portal is facing the wrong way X-Git-Tag: RELEASE_0_2_0_RC1~252 X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=a04fd1b40592a06734300f539087e109892f2854 major speed gain in cavetest2 by checking if the portal is facing the wrong way git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@2354 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rsurf.c b/gl_rsurf.c index f5fca788..ef815ae6 100644 --- a/gl_rsurf.c +++ b/gl_rsurf.c @@ -1523,7 +1523,7 @@ static void R_DrawPortal_Callback(const void *calldata1, int calldata2) memset(&m, 0, sizeof(m)); m.blendfunc1 = GL_SRC_ALPHA; m.blendfunc2 = GL_ONE_MINUS_SRC_ALPHA; - m.wantoverbright = false; + //m.wantoverbright = false; R_Mesh_Matrix(&ent->matrix); R_Mesh_State(&m); R_Mesh_ResizeCheck(portal->numpoints, portal->numpoints - 2); @@ -1774,13 +1774,18 @@ static void R_PortalWorldNode(entity_render_t *ent, mleaf_t *viewleaf) // follow portals into other leafs for (p = leaf->portals;p;p = p->next) { - leaf = p->past; - if (leaf->worldnodeframe != r_framecount) + // LordHavoc: this DotProduct hurts less than a cache miss + // (which is more likely to happen if backflowing through leafs) + if (DotProduct(modelorg, p->plane.normal) < (p->plane.dist + 1)) { - leaf->worldnodeframe = r_framecount; - // FIXME: R_NotCulledBox is absolute, should be done relative - if (leaf->pvsframe == r_pvsframecount && R_NotCulledBox(leaf->mins, leaf->maxs)) - leafstack[leafstackpos++] = leaf; + leaf = p->past; + if (leaf->worldnodeframe != r_framecount) + { + leaf->worldnodeframe = r_framecount; + // FIXME: R_NotCulledBox is absolute, should be done relative + if (leaf->pvsframe == r_pvsframecount && R_NotCulledBox(leaf->mins, leaf->maxs)) + leafstack[leafstackpos++] = leaf; + } } } } @@ -1788,7 +1793,6 @@ static void R_PortalWorldNode(entity_render_t *ent, mleaf_t *viewleaf) R_DrawPortals(ent); } - void R_PVSUpdate (mleaf_t *viewleaf) { int i, j, l, c, bits, *surfacepvsframes, *mark;