How can I render a scene to a surface

Two cameras in different levels. Within camera B’s view you can see a plane. On that plane I want to render what camera A can see.

I’m not asking for code specifics, but really just pointers in the right direction/what to look for. If there are particular functions that help with specifically this, mentioning those would be appreciated. Cheers.

Just going to provide a working non-Unity-Pro solution for anyone else that comes across this.

It’s true that you can’t use RenderTexture() without Pro, but you don’t need it. What you can do instead is use a shader with a ColorMask of 0.

Create 2 cameras, and chuck an object in the view of Camera 2 and another object in the view of Camera 1. On Camera 2’s object place a material that has the following shader, and then render first Camera 1, then Camera 2. To do this, simply go to the Inspector and set Camera 1´s Depth to 1, and Camera 2´s Depth to 2.

Camera 2’s render will completely cover that of the Camera 1, except for where the object is, creating a functioning hole in the air that you can look through to see what’s in the view of Camera 1.


Shader “DepthMask” {
ColorMask 0 // Masks the object with no rendering to all colour
Pass {} // Render the object, which in this case means disabling
} }

Thanks to Tenebraus for pointing this out.

I think this can help you to do what you want :

I’m very sorry, but I can’t get this to work in Unity 4.0

Can someone please elaborate on this?