- Home /
How to set the camera to render object exactly the same with what the other camera is rendering ?
Hi everyone. I have a project that need to show on how the occlusion culling is done. I have 2 camera which is "Camera1" and "Camera2". Camera1 is a camera that is used for the player to play game(Third Person View) with occlusion culling enabled. Camera2 is a camera that is used as a proof that occlusion culling is working in Camera1 by setting the Camera2 view from the top. I set it from the top to show the user that occlusion culling in Camera1 is working.
My question is that how can I set my Camera2 to render and not rendering object exactly the same as what Camera1 is rendering. I just want my Camera2 to render object according to what Camera1 is rendering. I would be very appreciate if you can show me the code as I am still new in Unity. Thank you.
That's not technically a reply as I didn't really do something like this ever, just a tip to get started on your own research.
You could check if an object is rendered by your player camera by doing something like in this threads answer: https://answers.unity.com/questions/8003/how-can-i-know-if-a-gameobject-is-seen-by-a-partic.html
Then for each visible object you could set to other layer and only render that layer in your second camera.