X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=gl_rsurf.c;h=ef815ae6c871507c080f4b19a9cdd7e355920ef8;hb=00322258fc19f151087caff9cacef0d7589f7fb4;hp=f5fca7888c6db21d05c72e9a8088f01527d89227;hpb=d5fef1c90c39fd59bf139e8a2c080ec75ef37187;p=xonotic%2Fdarkplaces.git 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;