]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
gl_rmain: Perform lightmap updates only on visible surfaces. Fixes AD perf
authorcloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Aug 2020 16:36:30 +0000 (16:36 +0000)
committercloudwalk <cloudwalk@d7cf8633-e32d-0410-b094-e92efae38249>
Tue, 18 Aug 2020 16:36:30 +0000 (16:36 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@12907 d7cf8633-e32d-0410-b094-e92efae38249

gl_rmain.c

index 19f97cf8e3c6a06c00982b0fbeff30d964f58dae..6a69bdd656eae5b5c9497aaa1ea4a4873a5b242e 100644 (file)
@@ -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);