So I'm having a bit of a problem getting my head around stencil shaders. Right now I basically want a shader to attach to a plane that will show a completely different "world" behind it. I know stencil buffers can be used to reveal certain objects, however I basically want to replace the entire world. I have made the plane spontaneously appear in front of some objects that have just a standard shader attached to them. I also have some other different objects in the same area that require the stencil shader to appear. I want the plane to basically filter out all the normal objects and then reveal the hidden objects. So I know I can make the plane's shader set the stencil buffer to 1 and then have all the hidden objects require a stencil buffer value of 1 to reveal. However I want the other objects to disappear, but I don't want to modify their shaders. How can I do this?
you'd probably want to use a portal effect for this one instead of a shader. basically setup both worlds in a single scene such that the player cant see them directly. only through a window portal. you can make such a portal using cameras and render textures. here's a link to the video if you need a full walkthrough on how to do it: