Solution for using custom depth with a Masked Material? (Or at least a proper substitute?)

I have a question for a project I’ve been working on for a very long time. I’ve been trying to make a proper Doctor Who RPG that’s mostly just a fan inspired passion project. It’s meant to sort of be a recreation of the old Doctor Who Experience Theme Park before it got shut down. I’ve managed to make my bigger on the inside effect work via stencils with custom depth, but it will only work with transparent materials and, as a result, I lose my depth with my meshes.

Here’s a video that shows what I’m talking about (I know the portal has a couple of issues in it too, I’ve fixed that for the most part):
https://youtu.be/39Hed0i0n6I

Is there anyway I could make custom depth work with Masked Materials instead? And If not, what would the better solution be? Could I make a custom material class in C++ that would suit this better? Could I use HLSL somehow? I appreciate the help and can’t wait to make this operational.