From: cloudwalk Date: Tue, 20 Oct 2020 10:58:29 +0000 (+0000) Subject: gl_rmain: Don't draw any entities except the world and viewent if floating in the... X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=9326b2253b1242da6cc7a891e38acf247ceb2d16;p=xonotic%2Fdarkplaces.git gl_rmain: Don't draw any entities except the world and viewent if floating in the void. Massive performance improvement on many large maps when flying in the void. git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@13028 d7cf8633-e32d-0410-b094-e92efae38249 --- diff --git a/gl_rmain.c b/gl_rmain.c index 350ae2d2..dd222050 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -4071,6 +4071,11 @@ static void R_View_UpdateEntityVisible (void) for (i = 0;i < r_refdef.scene.numentities;i++) { ent = r_refdef.scene.entities[i]; + if (ent != &cl.viewent.render && r_refdef.viewcache.world_novis) + { + r_refdef.viewcache.entityvisible[i] = false; + continue; + } if (!(ent->flags & renderimask)) if (!R_CullBox(ent->mins, ent->maxs) || (ent->model && ent->model->type == mod_sprite && (ent->model->sprite.sprnum_type == SPR_LABEL || ent->model->sprite.sprnum_type == SPR_LABEL_SCALE))) if ((ent->flags & (RENDER_NODEPTHTEST | RENDER_WORLDOBJECT | RENDER_VIEWMODEL)) || r_refdef.scene.worldmodel->brush.BoxTouchingVisibleLeafs(r_refdef.scene.worldmodel, r_refdef.viewcache.world_leafvisible, ent->mins, ent->maxs))