"Portals" with SceneCapture2D problem

Hi,
I am trying to make portals (like in Valve’s “Portal”) in UE4 and I am facing a problem, but it is complicated to explain so I made a drawing:

My problem is: There are some obstacles and a wall between the SceneCapture and the Portal 1 and they have not to be rendered (all the red cone), but after the portal all the content of the blue room needs to be rendered.
I am searching for a way to solve this problem (even in C++ if it is the only way).

Thanks a lot for your help, and if I did not explained correctly, please let me know it.

CaptainScience, thanks a lot for the link, that is what I was searching!
I have already made all the camera rotation and position settings, all fits perfectly but the last thing to do is this “Oblique Near-Plane Clipping”

Unfortunately I have no idea how to make it work, I will try, but if anyone find a complete solution before I do please tell me here.

What you’re looking for is called “Oblique Near-Plane Clipping”. You need to modify the camera frustum with the function provided here: Oblique View Frustum Near-Plane Clipping

Every frame you’d want to duplicate the player camera frustum in your portal camera, adjust it to the correct position, and then apply this function to clip all near geometry.

I’m not sure exactly how you’d set this up, and where to put the code exactly. Maybe you could write a custom Blueprint node that would take in a camera (or SceneCapture2D which is just a type of camera) and apply this function to it.

Did you eventually manage to solve this?

If not, try looking for “zNear” options for the camera. That’s usually what it gets referred to as (from what I know of OpenGL at least). I’d be surprised if this wasn’t implemented in some way in UE4, because it’s probably quite useful for a lot of 2d games.