Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighting updates, new starlight #12891

Merged
merged 17 commits into from
Mar 12, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Ready for TM
volas committed Feb 28, 2024
commit 974f8fc1fd204a62020e63da0494767c02c0387f
1 change: 0 additions & 1 deletion code/_onclick/hud/fullscreen.dm
Original file line number Diff line number Diff line change
@@ -206,7 +206,6 @@

/atom/movable/screen/fullscreen/meta/environment_lighting_color/proc/end_transition(obj/effect/level_color_holder/new_holder)
if(!current_holder)
world.log << "end_transition to [new_holder?.color]"
color = null
vis_contents += new_holder
current_holder = new_holder
22 changes: 13 additions & 9 deletions code/_onclick/hud/rendering/plane_master.dm
Original file line number Diff line number Diff line change
@@ -25,7 +25,7 @@
apply_effects(mymob)

//For filters and other effects
/atom/movable/screen/plane_master/proc/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/proc/apply_effects(mob/mymob, iscamera = FALSE)
return

///Level below the floor, for undertile component
@@ -52,7 +52,7 @@
blend_mode = BLEND_OVERLAY
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/game_world/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/game_world/apply_effects(mob/mymob, iscamera = FALSE)
remove_filter("AO")
if(istype(mymob) && mymob?.client?.prefs?.ambientocclusion)
add_filter("AO", 1, drop_shadow_filter(x = 0, y = -2, size = 4, color = "#04080FAA"))
@@ -83,7 +83,7 @@
plane = GHOST_ILLUSION_PLANE
render_relay_plane = RENDER_PLANE_ABOVE_GAME

/atom/movable/screen/plane_master/ghost_illusion/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/ghost_illusion/apply_effects(mob/mymob, iscamera = FALSE)
remove_filter("ghost_illusion")
add_filter("ghost_illusion", 1, motion_blur_filter(x = 3, y = 3))

@@ -116,11 +116,11 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/lighting/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/lighting/apply_effects(mob/mymob, iscamera = FALSE)
if(!istype(mymob))
return

mymob.overlay_fullscreen("lighting_backdrop_darkness", /atom/movable/screen/fullscreen/meta/darkness)
mymob.overlay_fullscreen("darkness", /atom/movable/screen/fullscreen/meta/darkness)

/atom/movable/screen/plane_master/exposure
name = "exposure plane master"
@@ -131,7 +131,7 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/exposure/apply_effects(mob/mymob) // todo: prefs
/atom/movable/screen/plane_master/exposure/apply_effects(mob/mymob, iscamera = FALSE) // todo: prefs
remove_filter("blur_exposure")
if(!istype(mymob))
return
@@ -153,7 +153,7 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/lamps_selfglow/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/lamps_selfglow/apply_effects(mob/mymob, iscamera = FALSE)
remove_filter("add_lamps_to_selfglow")
remove_filter("lamps_selfglow_bloom")

@@ -202,7 +202,7 @@
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
render_relay_plane = RENDER_PLANE_GAME

/atom/movable/screen/plane_master/lamps_glare/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/lamps_glare/apply_effects(mob/mymob, iscamera = FALSE)
remove_filter("add_lamps_to_glare")
remove_filter("lamps_glare")

@@ -228,12 +228,16 @@

var/atom/movable/screen/fullscreen/meta/environment_lighting_color/color_filter

/atom/movable/screen/plane_master/environment_lighting/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/environment_lighting/apply_effects(mob/mymob, iscamera = FALSE)
remove_filter("guassian_blur")

if(!istype(mymob))
return

// i have no idea how to make this plane work on the cameras
if(iscamera)
alpha = 0

add_filter("guassian_blur", 1, gauss_blur_filter(10))

// by default every z-level has one object as environment color holder
2 changes: 2 additions & 0 deletions code/_onclick/hud/rendering/plane_master_controller.dm
Original file line number Diff line number Diff line change
@@ -21,6 +21,8 @@
LIGHTING_LAMPS_SELFGLOW,
LIGHTING_LAMPS_PLANE,
LIGHTING_LAMPS_GLARE,
ENVIRONMENT_LIGHTING_PLANE,
ENVIRONMENT_LIGHTING_LOCAL_PLANE,
ABOVE_LIGHTING_PLANE,
)

2 changes: 1 addition & 1 deletion code/_onclick/hud/rendering/render_plate.dm
Original file line number Diff line number Diff line change
@@ -40,7 +40,7 @@
plane = RENDER_PLANE_GAME
render_relay_plane = RENDER_PLANE_MASTER

/atom/movable/screen/plane_master/rendering_plate/game_world/apply_effects(mob/mymob)
/atom/movable/screen/plane_master/rendering_plate/game_world/apply_effects(mob/mymob, iscamera = FALSE)
// singularity
remove_filter("singularity_0")
remove_filter("singularity_1")
2 changes: 1 addition & 1 deletion code/game/machinery/computer/camera.dm
Original file line number Diff line number Diff line change
@@ -101,7 +101,7 @@
instance.del_on_map_removal = FALSE
instance.screen_loc = "[map_name]:CENTER"

instance.apply_effects(user)
instance.apply_effects(user, iscamera = TRUE)
user.client.register_map_obj(instance)

user.client.register_map_obj(cam_background)
2 changes: 1 addition & 1 deletion code/game/turfs/turf.dm
Original file line number Diff line number Diff line change
@@ -342,7 +342,7 @@
// BYOND never deletes turfs, when you "delete" a turf, it actually morphs the turf into a new one.
// Running procs do NOT get stopped due to this.
var/old_opacity = opacity
var/old_lighting_object = lighting_object // todo
var/old_lighting_object = lighting_object
var/old_lighting_corner_NE = lighting_corner_NE
var/old_lighting_corner_SE = lighting_corner_SE
var/old_lighting_corner_SW = lighting_corner_SW
2 changes: 1 addition & 1 deletion code/modules/lighting/environment.dm
Original file line number Diff line number Diff line change
@@ -10,7 +10,7 @@
appearance_flags = NO_CLIENT_COLOR | PIXEL_SCALE
var/locked = FALSE

// shared image we use as mask for environment turfs
// shared image we use as a mask for environment turfs
var/global/image/level_light_mask = create_level_light_mask() // global
/proc/create_level_light_mask()
var/image/I = image('icons/blank.dmi', "white")
22 changes: 16 additions & 6 deletions code/modules/maps/space_management/space_level.dm
Original file line number Diff line number Diff line change
@@ -16,10 +16,24 @@
envtype = new_traits[ZTRAIT_ENV_TYPE] || envtype

color_holder = new()
set_level_light(new /datum/level_lighting_effect/starlight) // todo: config

// any better place for this?
// todo: add map config
var/level_lighting_type
if(ZTRAIT_CENTCOM in traits)
level_lighting_type = /datum/level_lighting_effect/centcomm
else if(envtype == ENV_TYPE_SNOW)
level_lighting_type = /datum/level_lighting_effect/snow_map_random
else if(envtype == ZTRAIT_JUNKYARD)
level_lighting_type = /datum/level_lighting_effect/junkyard
else
level_lighting_type = /datum/level_lighting_effect/starlight

set_level_light(new level_lighting_type)

SSenvironment.update(z_value, envtype)

// can accept hex color or /datum/level_lighting_effect object
/datum/space_level/proc/set_level_light(color)
if(color_holder.locked)
return
@@ -36,14 +50,10 @@
if(effect.lock_after)
color_holder.locked = TRUE

/* if(!effect.transition_delay)
color_holder.color = effect.
return*/

var/previous_color = color_holder.color

// stop any current animation first
animate(color_holder, time = 0, color = previous_color, flags = ANIMATION_CONTINUE)
animate(color_holder, time = 0, color = previous_color, flags = ANIMATION_END_NOW)

for(var/effect_color in effect.colors)
animate(color_holder, time = effect.transition_delay, color = effect_color, flags = ANIMATION_CONTINUE)
3 changes: 1 addition & 2 deletions maps/boxstation_snow.json
Original file line number Diff line number Diff line change
@@ -7,6 +7,5 @@
"Environment Type": "Snow",
"Station": true,
"Snowstorm": true
}],
"environment_lighting": "snow map random"
}]
}