Seamless Portals

@ Interesting stuff! And fantastic write up, I generally prefer a well-written doc to a video.

I have a fairly simple but solid portal system on the marketplace - pure BP, but looks like it works on a fairly similar set of principiles to your tutorial, with a few pros and cons.

Your jump-cut soultion to the incorrect frame after exiting a portal is fantastic - my solution is indeed to disable occlusion culling. As you mention, there does not seem to be a command for it, but there is an option in the project settings, which requires restarting the editor. This, along with enabling the global clip plain, is the reason I distrib as a project instead of asset set.

Also interesting to notice bGameCameraCutThisFrame in the player camera manager is BP readonly, but the bCameraCutThisFrame in capture2d is BP R/W…

It’s also good to see the extra attention you are taking to minimise the performance impact on scenecapture, and using the players projection matrix (where I only grab the players FOV)

Also interesting to see your setup with the portal mesh and offset shader, I have an “inverted box” with “internal fins”

On the upside of my setup, it is fairly generalised, and will create a “visual clone” at the other end of the portal for an actor containing static/skel meshs

I hope I am wrong, but think we are both not quite far from VR portals without 1-frame lag - have a look at the rendering section of the engine, the HMD motion is done as late as possible, it seems planar reflections are a “special case” in being performed after HMD motion, and some engine modification is needed to get around this…

Right now I’m starting to look more seriously into a setup more along the lines of portal/portal2, using stencil buffer to lower both processing and ram requirements - which would also make recursive rendering more practical.

I have some ideas on how to do a decent physics setup, allowing portals to be placed against a wall, and for the “visual clones” at the other end of a portal to have functional physics interactions, but really need to do more research in this area. With luck, it could end up as a more general system than in the portal games - but I don’t expect so.

edit: I just submitted PR to allow setting cameracut in BP https://github.com/EpicGames/UnrealEngine/pull/5823 :slight_smile: