- Home /
Rendering a single fullscreen window across multiple monitors
Hello there Unity Answers! I'm currently working on a project here at work and could use some help. I'm attempting to render a single fullscreen window across multiple displays and after a bit of trial and error I stumbled upon an odd quirk which seems to have achieved just that.
I'm afraid I can't share my local project but below are the steps to reproduce this behavior.
Create a new empty Unity3D project
Create a new component and add somewhere in your scene. Make it run the following code during Start()
Screen.SetResolution( SCREEN_WIDTH, SCREEN_HEIGHT, false ); Display.displays[0].Activate();
Replace SCREEN_WIDTH and SCREEN_HEIGHT with values as appropriate. Setting these values to something smaller than your target screen creates a borderless window centered in the middle of your display. Setting them to the same height, but a larger width will create a window which draws fullscreen and onto the next display. Setting the width equal to both displays and the height as your display's height results in a fullscreen window drawing across both displays.
Build and run, and admire your new fullscreen window
I've read through the documentation but haven't been able find anything which explains this behavior. Does anyone here know how this is working? It only seems to apply to the 0th display, as sending a different camera to the 3rd screen and calling Display.Activate() on it renders a fullscreen window which fills only that display instead of my provided window dimensions. Setting the screen dimensions from within Display.Activate() didn't have the same results either and attempts to duplicate this behavior onto a third and fourth monitor have so far proven unsuccessful.
I'm running on Windows and have tested this effect in both Unity 5.4 and Unity 5.5. This question has also been crossposted to the /r/Unity3D community and can be found here
Answer by tanoshimi · Feb 01, 2017 at 08:37 PM
I'm not sure exactly what you want to know in terms of how it works, but I wrote a blog post a couple of years back describing how I created a game stretched across monitors: https://alastaira.wordpress.com/2015/05/15/creating-a-unity-game-stretched-over-two-monitors/
Thanks for the reply @tanoshimi. Based on my testing I seem to have duplicated the functionality of the -popupwindow flag you mentioned in your blogpost without explicitly providing it to the game.
$$anonymous$$y final project must render to three displays with two of them sharing the same fullscreen window ( this is due to technical limitations and an NDA prevents me from discussing any further detail ) so rendering to a texture and then displaying across two windows isn't a feasible solution, and neither is combining displays in my video card. It'd also be good to know how this behavior is being triggered so I can be sure that future versions of Unity won't prevent me from using this "feature" and perhaps gain further control of this behavior along the way.
Your answer
![](https://koobas.hobune.stream/wayback/20220612110123im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Borderless window in standalone player 5 Answers
Switch Monitor during Runtime 2 Answers
Fullscreen on a second (non primary) monitor 1 Answer
Fullscreen on non-primary monitor in OS X 0 Answers
using multiple monitors / video outputs? 5 Answers