From 2c621a3fc48dfd1468517616a24a2c1207f53317 Mon Sep 17 00:00:00 2001 From: cloudwalk Date: Tue, 18 Aug 2020 16:36:30 +0000 Subject: [PATCH] gl_rmain: Perform lightmap updates only on visible surfaces. Fixes AD perf git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12907 d7cf8633-e32d-0410-b094-e92efae38249 --- gl_rmain.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gl_rmain.c b/gl_rmain.c index 19f97cf8..6a69bdd6 100644 --- a/gl_rmain.c +++ b/gl_rmain.c @@ -10088,7 +10088,8 @@ void R_DrawModelSurfaces(entity_render_t *ent, qboolean skysurfaces, qboolean wr int updated = 0; for (j = model->firstmodelsurface, endj = model->firstmodelsurface + model->nummodelsurfaces;j < endj;j++) { - if (update[j]) + // Update brush entities even if not visible otherwise they'll render solid black. + if (update[j] && (r_refdef.viewcache.world_surfacevisible[j] || ent != r_refdef.scene.worldentity)) { updated++; R_BuildLightMap(ent, surfaces + j); -- 2.39.2