Search Unity

Render same camera multiple times

Discussion in 'General Graphics' started by Innovine, Sep 25, 2018.

  1. Innovine

    Innovine

    Joined:
    Aug 6, 2017
    Posts:
    522
    The main interface to my game is simulating a security system, showing the feed from multiple security cameras, like this:



    I tried this using normalized view rect on the camera to render to a quarter of the screen. However, when I added support for multiple physical displays attached to the players computer, I noticed that it would be good to be able to display the footage from a single security camera twice. And not only that, but in different resolutions... so the camera showing the basement door might appear fullscreen on one of the players physical displays, and also as part of the quad view on the second display.

    To enable this, I changed to having an ortho camera with multiple planes on front of it, and assigning render textures to the planes, and this is working, and I can resize the planes and assign the different render textures to allow switching views and fullscreening some secuirty camera feeds, but I am concerned a bit about performance and quality of the graphics with this solution. Are there better ways to approach this?
     
    Last edited: Sep 25, 2018
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,348
    That's kind of the only way to do what you're trying to do, and it should be faster than what you were doing before. One optimization would be to only use a render texture on the cameras that are being displayed full screen, and otherwise use the view rects to render to the multiview screen buffer, or shared render texture.