How to create portals like in game Portal?
Can this feature be released in Unreal Engine? But only TRUE portals (worm-holes), not a render target circle from other camera? Any ideas for this?
asked Mar 24 '16 at 09:06 PM in Rendering
There are several tricks to achieve that "wormhole effect", which mainly consist on changing what the render target output is depending on where the player is/is looking. The videos showcase the use of screenalignedUVs on the material, but that still requires some logic so the effect looks good.
What I ended up doing is a simpler approach (albeit not as perfect as portal). Your portal is a rendertarget mesh, connected to a SceneCapture2D component which would be the other portal or whatever you want the portal to look like. Then, calculate the angle between the player-portal vector (literally portal.position - player.position) and the normal vector of the portal surface (the forward vector). Do that for every axis (be careful because the angles we're looking for are not in 3D space but 2D - i.e XY angle, XZ angle, etc).
With that information, rotate the SceneCapture2D component (either the portal or a secondary, invisible capture object), with the angles you've already calculated.
answered Oct 21 '18 at 11:14 AM
Follow this question
Once you sign in you will be able to subscribe for any updates here