From 9326b2253b1242da6cc7a891e38acf247ceb2d16 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Tue, 20 Oct 2020 10:58:29 +0000 Subject: [PATCH] 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 --- gl_rmain.c | 5 +++++ 1 file changed, 5 insertions(+) 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)) -- 2.39.2