Files
Bubberstation/code/modules/visuals/render_steps.dm
LemonInTheDark 2b2cb3dff6 Hologram Touchup (Init savings edition) (#74793)
## About The Pull Request

### Polishes and Reworks Holograms

Hologram generation currently involves a bunch of icon operations, which
are slow.
Not to mention a series of get flats for the human models, which is even
worse.

We lose 0.05 seconds of init to em off just the 2 RCD holograms. it
hurts man.

So instead, let's use filters and render steps to achive the same
effect.

While I'm here I'll dim the holo light and make it blue, make the
hologram and its beam emissive (so they glow), and do some fenangling
with move_hologram() (it doesn't clear the hologram off failure anymore,
instead relying on callers to do that) to ensure holocalls can't be
accidentially ended by moving out of the area.

Ah and I added RESET_ALPHA to the emissive appearance flags, cause the
alpha does override and fuck with color rendering, which ends up looking
dumb. If we're gonna support this stuff it should be first class not
accidential.

### Makes Static Not Shit

While I'm here (since holograms see static) lets ensure the static plane
is always visible if you're seeing through an ai eye.

The old solution was limited to applying it to JUST ais, which isn't
satisfactory for this sort of thing and missed a LOT of cases (I didn't
really get how ai eyes worked before I'ma be honest)

I'm adding a signal off the hud for it detecting a change in its eye
here.
This is semi redundant, but avoids unneeded dupe work, so I'm ok with
it.

The pipeline here is less sane then I'd like, but it works and that's
enough

## Why It's Good For The Game


![dreamseeker_zMiLXzlZ2X](https://user-images.githubusercontent.com/58055496/232470136-add945da-5f76-469e-ba1a-6ed3159b6f5b.png)
More pretty, better ux, **static works**

## Changelog
🆑
add: Holograms glow now, pokes at the lighting for holocalls in general
a bit to make em nicer.
qol: You can no longer accidentally end a holocall (as a non ai) by
leaving the area. Felt like garbage
fix: Fixes static rendering improperly if viewed by a non ai
/🆑
2023-04-18 18:25:52 -06:00

82 lines
2.5 KiB
Plaintext

/**
* Internal atom that uses render relays to apply "appearance things" to a render source
* Branch, subtypes have behavior
*/
/atom/movable/render_step
name = "render step"
plane = DEFAULT_PLANE
layer = FLOAT_LAYER
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
//Why?
//render_targets copy the transform of the target as well, but vis_contents also applies the transform
//we'll display using that, so we gotta reset
appearance_flags = KEEP_APART|KEEP_TOGETHER|RESET_TRANSFORM
/atom/movable/render_step/Initialize(mapload, source)
. = ..()
verbs.Cut() //Cargo cultttttt
render_source = source
/atom/movable/render_step/ex_act(severity)
return FALSE
/atom/movable/render_step/singularity_act()
return
/atom/movable/render_step/singularity_pull()
return
/atom/movable/render_step/blob_act()
return
//Prevents people from moving these after creation, because they shouldn't be.
/atom/movable/render_step/forceMove(atom/destination, no_tp=FALSE, harderforce = FALSE)
if(harderforce)
return ..()
/**
* Render step that modfies an atom's color
* Useful for creating coherent emissive blockers out of things like glass floors by lowering alpha statically using matrixes
* Other stuff too I'm sure
*/
/atom/movable/render_step/color
name = "color step"
//RESET_COLOR is obvious I hope
appearance_flags = KEEP_APART|KEEP_TOGETHER|RESET_COLOR|RESET_TRANSFORM
/atom/movable/render_step/color/Initialize(mapload, source, color)
. = ..()
src.color = color
/**
* Render step that makes the passed in render source block emissives
*
* Copies an appearance vis render_target and render_source on to the emissive blocking plane.
* This means that the atom in question will block any emissive sprites.
* This should only be used internally. If you are directly creating more of these, you're
* almost guaranteed to be doing something wrong.
*/
/atom/movable/render_step/emissive_blocker
name = "emissive blocker"
plane = EMISSIVE_PLANE
appearance_flags = EMISSIVE_APPEARANCE_FLAGS|RESET_TRANSFORM
/atom/movable/render_step/emissive_blocker/Initialize(mapload, source)
. = ..()
src.color = GLOB.em_block_color
/**
* Render step that makes the passed in render source GLOW
*
* Copies an appearance vis render_target and render_source on to the emissive plane
*/
/atom/movable/render_step/emissive
name = "emissive"
plane = EMISSIVE_PLANE
appearance_flags = EMISSIVE_APPEARANCE_FLAGS|RESET_TRANSFORM
/atom/movable/render_step/emissive/Initialize(mapload, source)
. = ..()
src.color = GLOB.emissive_color