Lamp Bloom, Exposure and Glare (#24534)

* Light Update

* Not failing tests I hope

* Whitespace Removal

* Tweaking here and there

* Merge Conflict Fix

* Rebuild TGUI Bundle to Fix Merge Conflict

* Settings are now in "Game Preferences" too

* ColorMatrix formatting and removal of unused procs

* A little mistake on matrices

* A little mistake x2 (last I hope)

* Moving Glare under every other effect, tweaking values, playing with blending

* Update TGUI Bundle for Merge Conflict

* Apply suggestions from code reviews

* Fuck it, it just works

* No tabs cool

* Remove unused

* Am I retarded

* We better return

* Whitespace we need

* oh

* New SQL update version

* Missing comma fix and recompiled tgui.bundle

* Updating SQL version in misc_defines and config

* Remove datum in holder

* BloomEdit empty lines removal

* No more unneeded functions calls

* Tgui.bundle rebuild

* SQL Changes

* SQL Version = 56 now

* Documentation and some formatting

* tgui.bundle.js rebuild

* Remove unused layers and variables

* Allow cameras to render backdrops

* Possible runtime issue fix

* Remove "baked" bloom from the lamps

* Revert the "remove". Make it low on alpha channel

* Shuttle rotation light update fix

* We don't need this

* Possible runtime issue fix x2

* tgui.bundle.js update

* tgui.bundle.js update

* tgui.bundle.js update

* Revert config.toml changes

* Revert the revertion of config.toml changes

* Bring that config changes back!

* Entry added

* tgui.bundle.js update

* Prettier possible fix (?)

* Runtime fix (and broken tubes now have light after reinstalling them)

* config update

---------

Co-authored-by: Mikhail Dzianishchyts <mikhail.dzianishchyts@gmail.com>
This commit is contained in:
RomainzZ
2024-07-05 21:16:16 +00:00
committed by GitHub
co-authored by Mikhail Dzianishchyts
parent 97eb823d4e
commit e386cfd9bf
28 changed files with 774 additions and 54 deletions
+45
View File
@@ -120,3 +120,48 @@
/mob/living/proc/mob_light(_color, _range, _power, _duration)
var/obj/effect/dummy/lighting_obj/moblight/mob_light_obj = new (src, _color, _range, _power, _duration)
return mob_light_obj
/atom/proc/update_bloom()
cut_overlay(glow_overlay)
cut_overlay(exposure_overlay)
if(glow_icon && glow_icon_state)
glow_overlay = image(icon = glow_icon, icon_state = glow_icon_state, dir = dir, layer = 1)
glow_overlay.plane = LIGHTING_LAMPS_PLANE
glow_overlay.blend_mode = BLEND_ADD
if(glow_colored)
var/datum/color_matrix/mat = new(
light_color,
GLOB.configuration.lighting_effects.glow_contrast_base + GLOB.configuration.lighting_effects.glow_contrast_power * light_power,
GLOB.configuration.lighting_effects.glow_brightness_base + GLOB.configuration.lighting_effects.glow_brightness_power * light_power)
glow_overlay.color = mat.get()
add_overlay(glow_overlay)
if(exposure_icon && exposure_icon_state)
exposure_overlay = image(icon = exposure_icon, icon_state = exposure_icon_state, dir = dir, layer = -1)
exposure_overlay.plane = LIGHTING_EXPOSURE_PLANE
exposure_overlay.blend_mode = BLEND_ADD
exposure_overlay.appearance_flags = RESET_ALPHA | RESET_COLOR | KEEP_APART
var/datum/color_matrix/mat = new(
1,
GLOB.configuration.lighting_effects.exposure_contrast_base + GLOB.configuration.lighting_effects.exposure_contrast_power * light_power,
GLOB.configuration.lighting_effects.exposure_brightness_base + GLOB.configuration.lighting_effects.exposure_brightness_power * light_power)
if(exposure_colored)
mat.set_color(
light_color,
GLOB.configuration.lighting_effects.exposure_contrast_base + GLOB.configuration.lighting_effects.exposure_contrast_power * light_power,
GLOB.configuration.lighting_effects.exposure_brightness_base + GLOB.configuration.lighting_effects.exposure_brightness_power * light_power)
exposure_overlay.color = mat.get()
var/icon/EX = icon(icon = exposure_icon, icon_state = exposure_icon_state)
exposure_overlay.pixel_x = 16 - EX.Width() / 2
exposure_overlay.pixel_y = 16 - EX.Height() / 2
add_overlay(exposure_overlay)
/atom/proc/delete_lights()
cut_overlay(glow_overlay)
cut_overlay(exposure_overlay)
QDEL_NULL(glow_overlay)
QDEL_NULL(exposure_overlay)
+3
View File
@@ -57,6 +57,7 @@
/datum/light_source/Destroy(force)
remove_lum()
if(source_atom)
source_atom.delete_lights()
LAZYREMOVE(source_atom.light_sources, src)
if(top_atom)
@@ -217,6 +218,8 @@
if(update)
needs_update = LIGHTING_CHECK_UPDATE
applied = TRUE
if(source_atom)
source_atom.update_bloom()
else if(needs_update == LIGHTING_CHECK_UPDATE)
return //nothing's changed