Ports /tg/ and CM planemasters to replace our renderers. (#21458)

Part one of our nefarious plans to destroy lag forever, and also
accomplish some cool shit.

This replaces our renderer system with plane masters, this will also be
used to turn skyboxes into backdrops and thus totally remove skybox
updating lag. Additionally, this will let us manipulate entire planes
very easily to do all sorts of zany shit. All credit goes to the
original coders, this is some seriously cool stuff.

Also fixes some bizarre smoothing behaviour, reduces updateoverlays
calls since now not every single structure in the game tries smoothing
with nothing.

<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/9b7cecd7-3c47-448b-9dd8-9b904640bf82"
/>
<img width="1349" height="1349" alt="image"
src="https://github.com/user-attachments/assets/647d75a2-1bff-45ca-ab92-0aea10631afd"
/>

---------

Co-authored-by: Matt Atlas <liermattia@gmail.com>
This commit is contained in:
Matt Atlas
2025-10-16 11:39:15 +00:00
committed by GitHub
co-authored by Matt Atlas
parent e30443943a
commit cca0dfe7b6
83 changed files with 789 additions and 734 deletions
@@ -12,6 +12,7 @@ would spawn and follow the beaker, even if it is carried or thrown.
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
unacidable = 1//So effect are not targeted by alien acid.
pass_flags = PASSTABLE | PASSGRILLE
blocks_emissive = EMISSIVE_BLOCK_GENERIC
/obj/effect/Destroy()
if(reagents)
-13
View File
@@ -85,16 +85,3 @@
/obj/effect/constructing_effect/proc/end()
qdel(src)
/// Example of a warp filter
/obj/effect/effect/warp
plane = WARP_EFFECT_PLANE
appearance_flags = PIXEL_SCALE
icon = 'icons/effects/352x352.dmi'
icon_state = "singularity_s11"
pixel_x = -176
pixel_y = -176
/obj/effect/obfuscation
icon_state = "1"
layer = OBFUSCATION_LAYER
+2 -2
View File
@@ -15,7 +15,7 @@
icon='icons/effects/beam.dmi'
icon_state="b_beam"
blend_mode = BLEND_ADD
plane = EFFECTS_ABOVE_LIGHTING_PLANE
plane = ABOVE_LIGHTING_PLANE
animate_movement = FALSE
var/tmp/atom/BeamSource
@@ -47,7 +47,7 @@
name = "bluespace"
icon = 'icons/turf/space.dmi'
icon_state = "bluespacify"
plane = EFFECTS_ABOVE_LIGHTING_PLANE
plane = ABOVE_LIGHTING_PLANE
layer = SUPERMATTER_WALL_LAYER
/obj/effect/overlay/temp
+25
View File
@@ -0,0 +1,25 @@
//------------------------------------------
//Shockwaves
//------------------------------------------
/obj/effect/shockwave
icon = 'icons/effects/shockwave.dmi'
icon_state = "shockwave"
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
plane = DISPLACEMENT_PLATE_RENDER_LAYER
pixel_x = -496
pixel_y = -496
vis_flags = 0
/obj/effect/shockwave/Initialize(mapload, radius, speed, easing_type = LINEAR_EASING, y_offset, x_offset)
. = ..()
if(!speed)
speed = 1
if(y_offset)
pixel_y += y_offset
if(x_offset)
pixel_x += x_offset
AddElement(/datum/element/temporary, 0.5 * radius * speed)
transform = matrix().Scale(32 / 1024, 32 / 1024)
animate(src, time = 0.5 * radius * speed, transform=matrix().Scale((32 / 1024) * radius * 1.5, (32 / 1024) * radius * 1.5), easing = easing_type)
+3 -3
View File
@@ -63,14 +63,14 @@
return
var/mob/M = entering
var/atom/movable/renderer/roofs/roof_plane = M.GetRenderer(/atom/movable/renderer/roofs)
var/atom/movable/screen/plane_master/roof/roof_plane = M.hud_used?.plane_masters["[ROOF_PLANE]"]
if(roof_plane)
roof_plane.alpha = 76
/datum/large_structure/tent/mob_moved(mob/mover, turf/exit_point)
. = ..()
if(!.)
var/atom/movable/renderer/roofs/roof_plane = mover.GetRenderer(/atom/movable/renderer/roofs)
var/atom/movable/screen/plane_master/roof/roof_plane = mover.hud_used?.plane_masters["[ROOF_PLANE]"]
if(roof_plane)
roof_plane.alpha = 255
@@ -269,7 +269,7 @@
/obj/structure/component/tent_canvas/Destroy() //When we're destroyed, make sure we return the roof plane to anyone inside
for(var/mob/M in loc)
var/atom/movable/renderer/roofs/roof_plane = M.GetRenderer(/atom/movable/renderer/roofs)
var/atom/movable/screen/plane_master/roof/roof_plane = M.hud_used?.plane_masters["[ROOF_PLANE]"]
if(roof_plane)
roof_plane.alpha = 255
return ..()
@@ -144,7 +144,7 @@
icon_state = "white"
anchored = TRUE
simulated = FALSE
plane = EFFECTS_ABOVE_LIGHTING_PLANE
plane = ABOVE_LIGHTING_PLANE
alpha = 100
var/datum/weakref/source
@@ -163,7 +163,7 @@
return
ClearOverlays()
var/mutable_appearance/MA = new(I)
MA.plane = EFFECTS_ABOVE_LIGHTING_PLANE
MA.plane = ABOVE_LIGHTING_PLANE
MA.appearance_flags = RESET_ALPHA
MA.alpha = 170
MA.pixel_x = 0
+1 -1
View File
@@ -50,7 +50,7 @@
icon_state = "starprojection"
mouse_opacity = TRUE
duration = 30 SECONDS
plane = EFFECTS_ABOVE_LIGHTING_PLANE
plane = ABOVE_LIGHTING_PLANE
light_power = 1
light_range = 1
light_color = LIGHT_COLOR_HALOGEN
+1 -1
View File
@@ -320,7 +320,7 @@
/obj/item/weldingtool/use_tool(atom/target, mob/living/user, delay, amount, volume, datum/callback/extra_checks)
var/image/welding_sparks = image('icons/effects/effects.dmi', welding_state)
welding_sparks.plane = EFFECTS_ABOVE_LIGHTING_PLANE
welding_sparks.plane = ABOVE_LIGHTING_PLANE
target.AddOverlays(welding_sparks)
. = ..()
target.CutOverlays(welding_sparks)
+1 -1
View File
@@ -58,7 +58,7 @@
/obj/effect/overlay/street_light
icon = 'icons/obj/structure/urban/poles.dmi'
icon_state = "street_light"
plane = EFFECTS_ABOVE_LIGHTING_PLANE
plane = ABOVE_LIGHTING_PLANE
/obj/effect/overlay/street_light/classic
icon_state = "classic_lamp_light"
+1 -1
View File
@@ -159,7 +159,7 @@
transform_matrix.Translate((((world.icon_size/2)+BASE_OFFSET_RIFLE_SLOT) - world.icon_size) + (i*INTER_OFFSET_RIFLE_SLOT), 0)
//Why not the rifle itself you might ask? Because there's the safety icon on it
var/mutable_appearance/weapon_appearance = mutable_appearance(G.icon, G.icon_state, plane = src.plane, flags = G.appearance_flags, layer = G.layer)
var/mutable_appearance/weapon_appearance = mutable_appearance(G.icon, G.icon_state, plane = src.plane, layer = G.layer)
weapon_appearance.transform = transform_matrix
visual_holder.overlays += weapon_appearance