Lighting performance tweaks (#2200)

Port of tgstation/tgstation#26975.

Changes the lighting engine to apply lighting changes in one step using stored lum value differences instead of two steps (remove_lum, add_lum).

Seems to show a speedup in lighting updates as well as a reduction in server memory usage due to aggressive freeing of unneeded lists.

Lighting overlays also default to fullbright instead of fulldark so movable area transitions look less strange.
This commit is contained in:
Lohikar
2017-05-15 14:25:13 -05:00
committed by skull132
parent 5cec2cfa6d
commit fac6d7916c
6 changed files with 250 additions and 260 deletions
+3 -11
View File
@@ -55,7 +55,7 @@ var/datum/controller/subsystem/lighting/SSlighting
if (!A.dynamic_lighting)
continue
new /atom/movable/lighting_overlay(T, TRUE)
new /atom/movable/lighting_overlay(T)
overlaycount++
CHECK_TICK
@@ -95,17 +95,9 @@ var/datum/controller/subsystem/lighting/SSlighting
var/datum/light_source/L = curr_lights[curr_lights.len]
curr_lights.len--
if(QDELETED(L) || L.check() || L.force_update)
L.remove_lum()
if(!QDELETED(L))
L.apply_lum()
L.update_corners()
else if(L.vis_update) //We smartly update only tiles that became (in) visible to use.
L.smart_vis_update()
L.vis_update = FALSE
L.force_update = FALSE
L.needs_update = FALSE
L.needs_update = LIGHTING_NO_UPDATE
processed_lights++