Announcement

Collapse
No announcement yet.

Simple Portals

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    [TUTORIAL] Simple Portals

    Hi!

    I see that many people interested portals feature.
    Here is small tutorial for you about.
    Hope it will be helpful.

    Wiki page:
    https://wiki.unrealengine.com/Simple_Portals

    Project files: (old)
    https://wiki.unrealengine.com/File:SimplePortals.zip

    Project files on google drive:
    https://drive.google.com/open?id=1QF...7ioSvxz6qsyJSo

    Example project contains:
    1. Examples for simple camera-screen setup:
    Click image for larger version  Name:	screens.jpg Views:	1 Size:	131.3 KB ID:	1504373

    2. Examples for simple mirrors:
    Click image for larger version  Name:	mirrors.jpg Views:	1 Size:	133.8 KB ID:	1503944

    3. Examples of simple portals:
    Click image for larger version  Name:	portals.jpg Views:	1 Size:	106.1 KB ID:	1503945

    Old demonstration video:


    Update 24/05/2017
    https://forums.unrealengine.com/comm...876#post992876

    Update 19/07/2018
    https://forums.unrealengine.com/comm...76#post1503676
    Last edited by redbox; 07-20-2018, 11:03 AM.
    Rocketeer

    my portfolio
    my youtube

    Camera Volumes
    Procedurally Instanced Meshes
    Simple Portals
    Water Flow For UDK
    Setup Swarm

    #2
    Update 24/05/2017

    This experimental project went a little further. So, here is small update.

    Wiki page:
    - Changed some text and pictures.
    - Changed description of example project.

    Example project (updated to UE 4.15.3):
    1. Added blueprint function library with basic math functions for portals operations (BP_PortalsFunctions).

    2. Added PlayerCameraManager class to handle camera transformations.
    Player character:
    - Added advanced teleportation example that works smoothly with camera/character transition through portal;
    - Added copy of skeletal mesh component, that used to visualize advanced teleportation;
    - Added ability to teleport through uniformly scaled portal, but needs to scale some more parameters;
    - Added simple PhysicsHandleComponent setup to manipulate physics objects.

    3. Added experimental physics actor class (BP_PhysActor), which can be teleported through portal. It also uses copy of StaticMeshComponent to visualize teleportation. It have few issues but maybe you can make some improvements.

    4. Added material function MF_ClipPlane, that uses world coordinates of specified clip plane to make material clipping through portal. Use it as opacity in masked/translucent material.

    5. Added material function MF_PortalPlane, that used as mask, to replace inner portal surface with color or texture. See material “M_PortalReplacement”.

    6. Portal actor:
    - Portals supports any scaling for basic portals math functions.
    - Portals supports uniform scaling for rendering portal view.

    Note that for now teleportation setup is fully dynamic. So, theoretically, it supports moving/rotating/scaling portals. And it may be unnecessary if your game uses static portals.

    Also, I tried to fix problem with portal surface clipping by camera near clip plane, using portal's render target in post process material.
    I’ve almost find formula for clipping mask, but suddenly I stuck with another problem - render target texture appears darker when used in post process material. I think it related to post process/HDR settings, but I don’t know how to fix it.
    So in example project it's disabled. You can enable it by connecting IsTrackTeleportation branch to Tick event in PlayerCameraManager class.
    Click image for larger version

Name:	clip_replace.jpg
Views:	1
Size:	21.8 KB
ID:	1128483
    Last edited by redbox; 07-20-2018, 11:02 AM.
    Rocketeer

    my portfolio
    my youtube

    Camera Volumes
    Procedurally Instanced Meshes
    Simple Portals
    Water Flow For UDK
    Setup Swarm

    Comment


      #3
      This is a fantastic tutorial,
      Any tips to have it work in VR?
      JcInventory, a Jigsaw Grid based Inventory designed in UMG and blueprint

      Comment


        #4
        Great work redbox

        Comment


          #5
          Update 19/07/2018

          Somewhere after release of UE4.19, I noticed that mirrors works incorrectly - they become flipped on Z axis.
          It looks that scene capture components no longer supports negative scale. Also I have done few improvements, so here is a new version of example project.

          Project files on google drive
          https://drive.google.com/open?id=1QF...7ioSvxz6qsyJSo

          Example project:
          1. Fixed mirrors material.
          2. Added base class “BP_BaseRenderSurface” for all provided actors. It contains basic functions for initialization of scene capture, optimization checks and so on.
          3. Fixed rendering lag for Mirrors and Portals. Thanks to FTC and his Free Portal Mechanics (https://forums.unrealengine.com/comm...rtal-mechanics)
          4. Added “BPC_SurfaceTracing” component, to hold portals recursive tracing functions.
          5. Added new example materials, with distance fade instructions for rendering optimizations.

          Wiki page:
          For now, Wiki is disabled for editing due to upgrade process. When it’s done, I will update wiki page according to fixes and improvements in example project.
          Rocketeer

          my portfolio
          my youtube

          Camera Volumes
          Procedurally Instanced Meshes
          Simple Portals
          Water Flow For UDK
          Setup Swarm

          Comment


            #6
            Thank You, Redbox

            Comment


              #7
              Has anyone created a VR portal? Any tutorials out there?

              Comment


                #8
                Originally posted by cyclopsys View Post
                Has anyone created a VR portal? Any tutorials out there?
                Check FTC Free Portal Mechanics thread https://forums.unrealengine.com/comm...rtal-mechanics
                Rocketeer

                my portfolio
                my youtube

                Camera Volumes
                Procedurally Instanced Meshes
                Simple Portals
                Water Flow For UDK
                Setup Swarm

                Comment

                Working...
                X