Search Unity

Video Different resolution on multiple screens

Discussion in 'Audio & Video' started by nevermannsland, Sep 16, 2019.

  1. nevermannsland

    nevermannsland

    Joined:
    Jul 30, 2019
    Posts:
    4
    Hello,
    I've got two canvases in a scene.
    A camera looks at each of the two canvases.
    In the code I have activated a second display.
    I want one canvas in the compiled application to appear on the main screen and the other canvas on the second screen. The two screens have a different resolution.
    In the Gameview of the Unity Editor everything works fine.

    The problem now is that after compiling, the second screen takes over the resolution of the first screen and is therefore displayed incorrectly.

    I compile the application with the player setting Fullscreen Windowed.
    If I don't activate the second screen in the code, I have the possibility to switch back and forth between fullscreen and windowed with alt+Enter and thus adjust the size.
    If I activate the second screen in the code, I can no longer use the alt+Enter shortcut.

    I tried different screen and display settings in the code and in the Unity editor but nothing led to success.


    Here is the code I run on startup

    Code (CSharp):
    1. void Start()
    2.     {
    3.  
    4.         //Effects only the Main Screen
    5.         Screen.SetResolution(2160, 3840, false);
    6.  
    7.         if (Display.displays.Length > 1)
    8.         {
    9.             Display.displays[1].Activate(1920, 1080, 60); // Has no effect
    10.         }
    11.  
    12.     }

    In Unity I assigned the two canvases to the render mode Screen Space - Overlay.
    I use the Unity version 2019.2.2f1.

    I've been looking for a solution for two days and seemingly just can't find one. If someone could give me a hint, that would be great.
     
  2. nevermannsland

    nevermannsland

    Joined:
    Jul 30, 2019
    Posts:
    4
    If this ist the wrong group for this topic can anyone give my an advice where to post ist correctly?
     
  3. simonkendrew

    simonkendrew

    Joined:
    Aug 31, 2017
    Posts:
    33
    Did you find an answer to this?
     
  4. nevermannsland

    nevermannsland

    Joined:
    Jul 30, 2019
    Posts:
    4
    No, not an answer but a workaround.
    I use two different applikations and the Spout-Plugin (https://github.com/keijiro/KlakSpout).
    One applikation is the sender of a videostream und the other applikation is the receiver.

    As far as I found out, unity doesn't let it run to two screens with two different resolutions.
    But maybe I'm wrong.
    Do you have another solution for the problem?
     
  5. Translunary

    Translunary

    Joined:
    Sep 9, 2019
    Posts:
    2
    Have you found a solution to this atleast by now?