Use RenderTextures or *something else*?

I’m looking for high-level input on how I can implement an idea- I have some initial thoughts but I worry I’m overthinking.

I want to create a 2d environment with the player in the vertical center, able to move horizontally but not vertically, with the top half of the screen showing one environment and the bottom half showing another environment.

My instinct is to use two cams outputting RenderTextures to two quads, each scaled to half the screen size, one for each environment. Then use a main camera to show the two quads as a whole screen.

But the implementation is slightly tricky, so I wanted to sense-check the idea before attacking it. Any tricks/shortcuts/gotchas much appreciated…

You dont even need the third camera or the render texture (unless you wanted to perform some other post process effect that would make this setup the ideal one). Just set the viewport of your two cameras so that each of them only draws to the half of the screen you want them to. Even if you used the render texture setup you’d still want to do this to ensure proper perspective and screen ratios.

3 Likes

https://docs.unity3d.com/Manual/class-Camera.html#:~:text=Normalized%20Viewport%20Rectangles

1 Like

Brilliant, thanks Sluggy and Ryiah. That’s way cleaner than what I was imagining. Exactly what I needed!