An assortment of Lighting Stuff (#6196)

* An assortment of Lighting Stuff

- Makes Lighting less uniform (Bay PR #19808)
- Has lights fetch lighting data from bulbs (Baystation PR #13614)

Ported from Baystation code.

There is currently an issue where there are unnatural dark spots. Simply removing and re-inserting the nearest lightbulb seems to remove these dark spots, which suggests it is an initialization issue.

* Ports the rest of 13614

* Changeling and Travis

* Feedback Fixes
This commit is contained in:
Novacat
2019-06-18 19:56:30 -04:00
committed by Anewbe
parent ee162e9e3d
commit 584a9a410c
7 changed files with 222 additions and 264 deletions

View File

@@ -189,7 +189,7 @@
);
// This is the define used to calculate falloff.
#define LUM_FALLOFF(C, T)(1 - CLAMP01(sqrt((C.x - T.x) ** 2 +(C.y - T.y) ** 2 + LIGHTING_HEIGHT) / max(1, light_range)))
#define LUM_FALLOFF(C, T)(1 - CLAMP01(((C.x - T.x) ** 2 +(C.y - T.y) ** 2 + LIGHTING_HEIGHT) ** 0.6 / max(1, light_range)))
/datum/light_source/proc/apply_lum()
var/static/update_gen = 1