Is it possible for a camera to render only certain layers?

Hi!

I’m just wondering if it’s possible for a camera to render specific layers?

An example would be a supernatural game where you can see a ghost on a security camera, but not in the room itself. For this I’d simply put the ghosts on their own layer and have the security camera capture the gameplay and ghosts layer, whilst the player camera only captures the gameplay layer.

If this is not currently possible, is there an alternative solution?

Many thanks!

I’m very interested in the answer to this question. I’d like to quickly isolate one object for rendering to a render texture.

The simplest solution might just be to toggle the visibility of each ghost when you are rendering from the security camera. Maybe you can attach the visibility toggle to a a custom event, so you can easily switch them all on before you capture the scene got the security view.

Toggling visibility is not possible in my case; I have 2 cameras that need to work simultaneousely together.

I’m also interested to know if there’s a way to let one camera/renderTarget2D render only one item or multiple items (a layer?).

I am looking for something similar, i need to combine 2 points of view, 2 camera images of differing angles onto the screen, all via blueprint

I did that! Using camera position and vector parameter is shader))) Comparing the shader’s position of the camera and camera position passed to the shader as a vector parameter. If they are equal, then set opacity to 0)) else to 1.

Hey, VinnyBlood, can you provide some demo of this amazing creation?
Will help me a lot, i’m searching for that more than 2 days, and nothing…
Can you provide a simple demo? Thank you.

Did u successed in ur material’s node. Does a mask can only work for some special camera? I think one mask just can work on all of camera render.

Amazing solution!
For this purposes in Unity there are render layers. But not in UE, unfortunately.
I was finding the way to do this in UE.
You give us the best way, thanks!

1 Like