-
Notifications
You must be signed in to change notification settings - Fork 5
Portal Depth
An optional, more advanced feature of this prefab is "portal depth". This adds an effect where you can appear to stick your hand (or objects) through the portal, instead of them being clipped off like when you normally stick your hand through a wall. It is only a rendering illusion; the object won't really stick out of the partner portal!
Enabling portal depth can be done by using the "PortalView" material instead of "PortalViewNoDepth". However, some changes to the world will be necessary to keep it from looking broken. Primarily, any "background" surface that appears nearby behind a portal (within 2 meters behind a portal), such as a wall, floor, or ceiling, needs to have a material with a Render Queue less than the PortalView material, which in turn must have a Render Queue less than 2000. The default Render Queue for the "PortalView" material is 1900. I suggest 1800 for the background surfaces.
[!] IMPORTANT: You CANNOT use the Standard shader for background surfaces, because VRChat will force all materials with the Standard shader to Render Queue 2000. If you use Standard set to 1800, it will look fine in the editor, but won't work in-game! That's why I have a "ExampleBackgroundSurfaceForPortalDepth" shader which you can use instead. Other shaders like Poiyomi World will work too.