This has been eating my brain for a few days by now and I wish I can get some wisdom from my good fellows here. I try to explain as best as I can below:
I work on a game where we switch between two different scenes rendered by two different cameras. Each camera renders directly into a RenderTexture. The reason it is rendered into a RenderTexture is that we want to apply effects while transitioning between the two scenes. Let's call these two scenes, scene A and scene B and camera that renders each scene is camera A and camera B.
I have a main camera also which I use for blitting with the OnRenderImage method. We have a shader that takes both RenderTextures from Camera A and Camera B and combines them using some effects.
In this game, some 2D/3D objects should be moved to the UI later at some point (e.g., inventory).
The inventory also has it's own layout which is placed in the canvas.
Now the problem is that because I use two RenderTexture I can't set the canvas to Screen space - Camera and my only option is Screen space - Overlay or world space. I really prefer to avoid world space because it would be much more complicated to setup everything and make sure that the UI correctly shows up under all situation. If I use screen space - overlay then the problem is that all 2D/3D objects that are moved to the UI during the gameplay would end up behind the canvas elements and I don't seem to have any way of making them go in front of canvas elements. Anyone has any ideas that could help me out here? I really appreciate your thoughts.
↧