From: cloudwalk Date: Tue, 18 Aug 2020 16:36:30 +0000 (+0000) Subject: gl_rmain: Perform lightmap updates only on visible surfaces. Fixes AD perf X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2c621a3fc48dfd1468517616a24a2c1207f53317;p=xonotic%2Fdarkplaces.git 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 --- 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);