Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Recreating UDK's UTPortals?

I recently started using Unreal Engine 4 and was disappointed to see the removal of the UTPortal actor. I've tried experimenting with SceneCapture2D and depth buffers to get a similar effect, but the resulting view, while three-dimensional, lacks any sort of perspective detection and the view remains stationary.

I essentially recreated the effect shown in this video https://www.youtube.com/watch?v=r5XAVy6wE-A

It's certainly better than just a flat real-time 2d texture, but it is a far cry from what the UTPortal actor could do. Does anybody have any ideas?

Product Version: Not Selected
more ▼

asked May 29 '14 at 11:44 PM in Using UE4

avatar image

6 2 3 5

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

4 answers: sort voted first

I have managed to recreate my UDK portal in UE4 (kind of). It is not in usable form and is not optimized. But if anyone is interested in creating portals, this might give you some ideas.

Here is the Scene setup and Gameplay demo

The blue print is shown below: alt text

Problems: It uses a large Render Target (same as the screen resolution), which results in low FPS. I hardcoded several things like resolution, eye height, active camera into the settings and blueprints * I could not find an option to set a near clip plane, so the illusion fails if player is too far away (other stuff will block the portal)

If anyone is interested I will try to make more screenshots of other assetts as well.

blueprint.png (335.8 kB)
more ▼

answered May 31 '14 at 04:26 PM

avatar image

3.3k 154 45 269

avatar image mindfane May 31 '14 at 04:39 PM

How it is done:

Basically I created 4 things:

  1. A Render Target which has same resolution as main camera output.

  2. An unlit material which uses the above render target. The 'Screen position' node is given as input for UV pin. (this will clip-out unwanted areas of the target)

  3. A blueprint named BP_Portal_Entry. This is the door that you want to get into. It is very simple setup. All it has are two static meshes. One is the door frame. Second one is a plane on which the material from step2 is applied,

  4. A blueprint named BP_Portal_Exit. All the logic is done here. It has a DoorFrame as a static mesh component. Under it we have an Arrow (not needed), and the arrow has a SceneRender2D component. This component is set to render to the Target I created in Step1. The Event graph is shown in the image.

Each tick, I calculate the relative position and rotation of the active player and his control rotation with respect to Entry portal. I use these values to set Relative position and rotation of the Arrow component in Exit portal. (the arrow is not needed. I put it there so that I can see if the orientation and position are correct). This in effect moves and orients the SceneCapture compoenent.

This is not an ideal setup. Many things are hardcoded. Ideally the logic should be moved to Entry portal whcih should hold a scenecapture comp. This was we could have multiple Entry portal to be linked to the same Exit portal.

Render target is too big. But only a fraction of it is being used most of the time (only the area within the door frame). Essentially we are rendering everything twice.

avatar image Musashi Ryu Oct 06 '14 at 08:54 AM

Hi Mindfane,

Could you share the blueprint, I would like to investigate this further and see if I can get this to work.

avatar image mindfane Oct 06 '14 at 10:28 AM

Hello there,

I dont know if I have the blueprints with me anymore. But I will see if I can find it and if I do, I will post it in the fourms: https://forums.unrealengine.com/showthread.php?7662-Recreating-UTPortal-from-UDK-in-UE4-%28the-portal-effect-from-Portal-in-UE4%29&p=64070#post64070

Please continue the discussions in the forums.

avatar image Jacky May 31 '14 at 04:44 PM

Hey everyone,

Why don't you carry this discussion to the forums so that more people can make use of all the information here? You may also get more participants and maybe even different solutions from others. :)

avatar image Finkton Jun 01 '14 at 05:24 AM

I posted it to the forum https://forums.unrealengine.com/showthread.php?7662-Recreating-UTPortal-from-UDK-in-UE4-%28the-portal-effect-from-Portal-in-UE4%29&p=64070#post64070

Also, is there a way to solve the lag of the portal image? I believe it is due to the use of pure ticks to time the camera movement

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Just an idea. Not sure how good it will work.

Setup a camera that points to the destination area. Positioned at the portal exit. Manipulate its properties (FOV, rotation..), based on the original player camaera - entry portal values. Ie if your original camera is at 45 degree angle with the entry portal plane, you adjust your secondary camera to be at 45 degrees with the exit portal plane. Then render the view given by the secondary camera onto a render target and use it to texture the entry portal surface.

I had tried the above method in UDK and got pretty good results. However it was simply a demo I did after playing portal and did not have anything to do with gameplay. SO I cannot say anything about how it will affect performance.

more ▼

answered May 30 '14 at 03:06 AM

avatar image

3.3k 154 45 269

avatar image Finkton May 30 '14 at 05:31 PM

alt text

I think it could work. This is my idea which expands upon yours a bit. But it requires culling an area between the SceneCapture camera and the back of the exit portal. Is this possible?

I'm relatively certain this is generally how the original UTPortal actor functioned.

revision.png (52.6 kB)
avatar image mindfane May 31 '14 at 03:37 AM

You could adjust the near clip-plane to get the culling..I think

Update: It looks like UE4 does not support custom NearClip Plane for SceneCapture2D component or cameras. UE3 had this feature.

I have created a demo by rotating the scenecapture2d component and adjusting its FOV angle based on distance. The results are far from ideal, but will give the player an illusion of a portal as long as he is not too close to it.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This is not my video, but it shows what you want to do :D.


more ▼

answered Nov 17 '15 at 03:07 PM

avatar image

210 15 25 80

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Don't ask me how it works, but I think it's what you're looking for. Scene Capture Components now have a Clip Plane Base and Clip Plane Normal attribute. Which is "useful for portals". I've tried using them, but couldn't get the values correct. Might be what you're looking for.

more ▼

answered Apr 22 '17 at 04:13 PM

avatar image

1 1

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question