- Home /
MirrorReflection with Multiple Cameras
I'm using this script by Aras Pranckevicius from the wiki to add reflections to a water shader I made: MirrorReflection3
However, my scene requires that I have more than one camera; one for background and sky and one for foreground. The reflection looks fine in scene view but while the game is running, the reflection only uses the image from the main foreground camera so the sky and background just show up as black.
Could someone help me edit this script to use the composite from both cameras and not just the single one?
Answer by Bunny83 · Dec 02, 2017 at 01:54 PM
Well, if you have two source cameras you need two reflection cameras. So you need to adjust your second camera in a similar way you adjust your main camera and render them in the right order. I guess you render your background cam first so make sure you actually render the background reflection cam first as well.
The script seems to take the image of the main camera and uses that as a reflection texture for the material. Are you saying the material should have two reflection texture nodes and each reflective service should have two scripts for each camera? If that's the case, how do I designate the second camera in the script?