Simple Portals

Hello.

BP_Mirror works like flat mirror, not cubemap, thats why it’s not rendered properly from any side.

I don’t understand what do you want to achieve with that other side mirror.

The first gif is if the player is inside the building, then player sees the inside reflected in the mirror, but my intention is to show the inside of the building from the outside, so I can use the SetOwnerNoSee the outside building mesh until he enters inside, the SceneCaptureComponent2D points to the inside of the building, and the PortalMesh with the assigned material points to the outside of the building.
that is why i only need a SceneCaptureComponent2D.

This is the problem I have, as you see the rotation and the scale are not right.
https://gyazo.com/f9fcd29b47ab58f60b9555f4d30f747c

https://gyazo.com/4a905413f0d85d3981ff326cec81dc4e

Here you can see the Blueprint and its components, the SceneCaptureComponent2D points inside and the MeshPortal shows the content in the opposite direction. As if it were a Window.
https://gyazo.com/821d3be2ecb3166edc25c39f72a2d53d

Well, I have solved it by anchoring a ChildActor and using the same logic as in the BP_Portal.
But the idea was to use a single BP_Portal and one or 2 SceneCaptureComponent2D.

Source portal uses target portal’s transform to calculate portal view.
So you can modify BP_Portal logic to use its own transform as target portal’s transform.

So in simple words you need to pass (source, source) instead of (source, target) to portal functions.

Ah, but it will be rotated on 180 yaw, because logic assumes that target portal is mirrored, and you need another portal fuction for that.

Hmm…
Ok, I think I can add such an object just for option.

Added BP_Window, just update project from github.
I hope you will learn something from it.

Nice! Now it works.
Now only have to investigate why on PC it works perfectly, but on a mobile device for augmented reality it looks so weird.

PC
ARCore

ok i’ve already fixed it, I set a custom projection matrix for the scenecapturecomponent2d