Search Unity

Multi-display

Discussion in 'General Graphics' started by steveEXC, Sep 15, 2017.

  1. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    Hey guys, I've got a multi display question here. It seems that I need a camera per display in order to render to each monitor. I'd like to render one camera view across multiple displays. How would I achieve something like this?

    Example:
    https://i.ytimg.com/vi/mURV9SmrzQ4/maxresdefault.jpg
     
  2. LennartJohansen

    LennartJohansen

    Joined:
    Dec 1, 2014
    Posts:
    2,394
    Some graphics cards lets you make a simulated display that spans all tree monitors. Then it should work direct.
     
  3. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    Thanks for your reply. I was hoping to achieve this without having to fiddle around with graphic card settings.
     
  4. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,276
    You can render the image into one big rendertexture and the blit the result splittet into the different cameras that put it to the screen.
     
  5. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    I'm not too familiar with Graphics.Blit(). After reading up on the documentation page, I think I might know what to do. If I have a three screen setup, would I create a fourth camera that would render the entire scene to a render texture, then use Graphics.Blit() to move that render texture onto 3 other render textures applied to quads that are each individually rendered by the other 3 cameras? Or is there an easier way that I'm missing?
     
  6. steveEXC

    steveEXC

    Joined:
    Nov 7, 2014
    Posts:
    11
    I got it figured out, Graphics.Blit() was definitely the way to go!

    I found a MonoBehaviour callback OnRenderImage(RenderTexture source, RenderTexture destination). I set up in my scene one main camera, and then one additional camera per display. Every camera that wasn't the main camera was set up to render nothing via the culling mask. I used the single main camera render to a source RenderTexture, then used that OnRenderImage callback on the other cameras in the scene and applied Graphics.Blit(source, dest, scale, offset) to show only a portion of the source RenderTexture relative to which display they were assigned to.