Okay, first I’m going to explain what I want to do (and already did):
Imagine a single plane in an empty scene with nothing else around it.
When you look at it from the front you can see a room “inside” that plane.
It is usually “not there” or “not visible” when you look behind the plane. It is only visible when you look through the plane from the front, but as I said there is nothing behind the thin gate.
Well, actually the room exists in the scene right behind the gate, but it is not rendered. It will only be rendered when you look at it “through” that plane (I call these “gates”).
The trick is quite simple, when you know the basics of a stencil buffer. I wrote a shader for the gate and one for the interior objects to be rendered just like that with some tutorials (eg. Stencil Buffers | Ronja's tutorials).
On top of that: I can create multiple “dimensions” since I can adress a specific stencil buffer using a reference number for masking (or unmasking if you want).
The big problem I have now is: My game does not use the HDRP at the moment, but I want and need the HDRP to create all other effects for my game as it is so nice and easy with the ShaderGraph!
Sad but true, the HDRP/ShaderGraph does not support access to the stencil buffer which is essential for my effect. THIS CAN’T BE IT!
Now the final question for you guys:
Can you help me find an HDRP applicable alternative that is easy to manage in my scenes that can handle multiple dimensions (simply small rooms) at once? I think I need around 20 dimensions at a time, so using 20 RenderTextures and cameras won’t work.
I was also having a look at Unity’s new Custom Pass Volumes in v2020.2, but I don’t really get to
know how to code them (yet?).
Do you have any other ideas? I really seek here for help on my last try to find a way for this.
Maybe the great grand @bgolus can find a way in his immense shader knowledge to bless my project. You really carry the shader community on this forum, big thanks to you! And as well a big thanks in advance to everyone who can help me solving this issue that haunts me for almost a year now.
Here are some example images using the common stencil buffer method:


