Offset render relays for non-offsetting planes to match highest matching render plane (#84184)

## About The Pull Request

**Alternate title: "Fix blind people getting so blind they become deaf
when going down a flight of stairs"**

So 'bout half a week to a week ago I overheard a friend complaining
about blind people not seeing runechat on lower multi-z levels. Asked a
bit, apparently they'd reported this about half a year ago, and it's
still an issue.
So in my never-ending hubris I decided to just go and fix it!
Now, admittedly? I really _really_ do not get the rendering system we
use.
The simple options were right out: we can't allow the fullscreens plane
to be offset, as this causes issues with looking up/down, or disallow
runechat from being offset, which causes issues with runechat from other
levels.

After poking our very cool and smart rendering guy several times over
the course of the last week, this is what we got to:

### The technical bits

We simply make the rendering relays for non-offsetting plane masters
point to the highest rendering plane that matches the target.
We do this by offsetting the rendering relays in place, by adjusting
their plane and layer values to match the new offset, with a new
`offset_relays_in_place(new_offset)` proc called in
`/datum/plane_master_group/proc/transform_lower_turfs(...)`.
Importantly, we compare the current layer values to what they should've
been, so we don't accidentally override relays with custom-set layers.

This fixes our issue (as tested on wawastation):
<details>
  <summary>Images</summary>
  

![image](https://github.com/tgstation/tgstation/assets/42909981/c6a10e04-dd08-4642-bc4d-d99ae5004a40)

![image](https://github.com/tgstation/tgstation/assets/42909981/740dc894-7495-4c35-b729-ffcc539ca928)

![image](https://github.com/tgstation/tgstation/assets/42909981/986433a7-e66e-408a-8e77-1f1eb89cb67c)
  
</details>

## Why It's Good For The Game

Fixes #80376.
## Changelog
🆑
fix: You can see runechat above fullscreen overlays on lower multi-z
levels again. Rejoice, blind players. Please report any weird rendering
layering issues.
/🆑
This commit is contained in:
_0Steven
2024-07-11 10:05:07 +02:00
committed by GitHub
parent d3f6c15283
commit 5e753b6788
9 changed files with 75 additions and 24 deletions

View File

@@ -319,6 +319,15 @@
#define PLANE_CRITICAL_FUCKO_PARALLAX (PLANE_CRITICAL_DISPLAY|PLANE_CRITICAL_NO_RELAY|PLANE_CRITICAL_CUT_RENDER)
//---------- Plane Master offsetting_flags -------------
// Describes how different plane masters behave regarding being offset
/// This plane master will not be offset itself, existing only once with an offset of 0
/// Mostly used for planes that really don't need to be duplicated, like the hud planes
#define BLOCKS_PLANE_OFFSETTING (1<<0)
/// This plane master will have its relays offset to match the highest rendering plane that matches the target
/// Required for making things like the blind fullscreen not render over runechat
#define OFFSET_RELAYS_MATCH_HIGHEST (1<<1)
/// A value of /datum/preference/numeric/multiz_performance that disables the option
#define MULTIZ_PERFORMANCE_DISABLE -1
/// We expect at most 3 layers of multiz