VR Portals using Custom Depth and Stencils feasibility?

I was wondering if there is anyone who has good knowledge of how custom depth and stencil buffers work to see if it is feasible of making a freestanding VR portal? Portals varying in our expectations and mental models of them. I’m not quite looking for the user to teleport through them yet. I’m just starting to learn about Post Processing materials and Custom Depth and Stencils and am just looking for general advice. Thanks.