Is there a way of reflecting a reflection in Unity?
I tried putting to put 2 blocks with a reflective surface infront of each other and this is what I get:
Is there a way of reflecting a reflection in Unity?
I tried putting to put 2 blocks with a reflective surface infront of each other and this is what I get:
Hmm… this is a tough one, and not one that I’m entirely certain has a catch-all answer. (Even more so because I don’t have much specific experience with reflection probes yet)
First off, you’re seeing black in the reflections because both surfaces are trying to render their RenderTextures simultaneously. If you look at one of those two cubes/planes, I assume the opposite cube/plane and sphere would both appear black in them as well.
If you consider a game like Portal, you can place a portal on a wall in front of you and a wall behind you, then look through for many repetitions of a portal looking at a portal. To that effect, Portal (both original and sequel, if not only the sequel) allow for customization of the degree of portal depth. If it’s limited to one, the second loop will not display, or not the third and so on.
In that case, the deepest RenderTexture for the image through a portal would render first, followed by the next closer to the player, then the next until the view reaches the player’s own camera. However, that’s a one-way system. The deepest view will always come first, working backwards towards the player.
In this case, two objects would be attempting to display each other’s textures simultaneously, before the frame has finished rendering and, therefore, before there is a RenderTexture available to display in the reflection.
Compounded on this is the fact that each reflection would not even be feasible in the first place. Consider that in order to display a reflection, you need a camera that’s able to provide that representation of a reflection. When you reflect off a sphere, the second reflection after that must now also be skewed to match the variable orientation of the reflection. If that reflection can also see the sphere again, now it’s truly become a nightmare which no camera in Unity can appropriately accommodate.
An alternative method only really applicable for a TV screen-style reflection (again, with minimal experience with reflection probes, however) could be to use the RenderTextures with a delay so they may be visible to each other, but sadly, I haven’t been able to locate any complete information on how to do so and this approach wouldn’t solve the problem of a mirror reflecting a mirror as-is, anyway.