How can I make an Object visible only through another object?

How can I make an object visible only in the viewing space of another object?
What I aim to do is to place a plane through which I can see some objects that are normally not visible.


I suggest using shaders/materials. This might be a bit more complicated but this should get you started:

Hope it helps some. If the link doesn’t explain it too much lemme know, I’ll try to answer your questions.

Do you think that is possible with this method to render the occluded object with its normal colors, shadows, reflections et cetera?

Hm, must say I’ve never tried it myself but I’d think it possible, but it depends on exact implementation of the occlusion object. Will it be only taking a part of the screen or the entire screen?

I think you could also resolve this via transparency (make object transparent, when not looking at it via occluding object). This might be tad more peformance demanding.

Other option would be to use method for triangle culling, although I’m not sure how much UE supports it. Basically just check whether you look at given object (as in the article) and use triangle culling to get rid of all non-occluded triangles.

If the occlusion object covers entire screen, then just have a “flag” that tells you, now it’s on, render all objects, otherwise just don’t render them (you don’t need to do this via materials at all, but can use coroutines to notify object they should start rendering and just enable them, and turn them off when you stop using occlusion object)

Not sure how much this helps.

I’d like to make a portal effect like this: - YouTube , but not recreating a teleport system that work with scece capture. I want to place the two worlds in the same space and make them alternatively visible and not visible trought a plane.
The problem with sceneapture is that it doesnt render planar reflections and that it’s bind to the camera player (so I cant export correct screenshots with ansel, because during the stich, the portal area becomes a mess).

ah this is completly different than what I thought you were looking for, sry but no idea there :frowning:

Thank you anyway!

did you ever find a solution to this?

Not sure if you still need this, but if you do or if anyone else does, to do this you will need a second camera that follows the movement of your character. For example, if you are in a red room, and you want a portal to show a green room (or, in your case, a room with different objets), you would have your character in the red room, and a second camera that reproduces the movements of your character but in a separate green room (hidden someplace else in your scene). So if you place the green room 1000 units to the right of the red room, you would have the second camera reproduce the movements of the main camera, but 1000 units to the right (which would be in the green room).

You can then set that second camera as “Render to Texture” (it will record whatever that camera sees and apply it in real time to a texture) and apply the resulting texture on a material. Then all you need to do is apply that material on a Plane in your red room and it will show the green room as in a portal.

For more info you can search for Unreal Render to Texture Portal on Google or Youtube, you should find a couple of examples and tutorials


julien that exactly how we did it! thanks for posting a good reply, i totally forgot to come back to this after we solved it lol