Exclusive Fullscreen (PC/Windows/Steam) does not work right

I have been researching this and trying to figure out why a feature that every other game seems to have that Unity does not seem to behave correctly or as described for PC (Windows).

Even new games like fall guys does not use an exclusive full screen mode. It uses what seems to be Fullscreen Windowed and locks the mouse to their view.

When trying to use the Screen.SetResolution with Exclusive fullscreen it gives all kind of strange results.
Even when passing in supported resolution and refresh rates.

The screen flickers way to much. It doesn’t always regain focus correctly. The window seems to get placed on my other monitors then moved to the correct one. Sometimes I see it rendered on two monitors.
When trying to select it sometimes after changing resolution it immediately loses focus and shrinks down.
Kicking off all the desktop black screens again. My other windows getting shuffled around, etc.

Most games have some kind of resolution change glitches. But something is really not right with unitys version of it. Unitys response seems to be that Fullscreen Windowed is the way to go. Even though it looses a lot of features like vsync, gsync/adaptive refreshs.

Has anyone gotten this too? I assume there is nothing to be done since big name games like fall guys and city skylines all basically have the same issues.

For now I will be doing what they did and remove exclusive fullscreen as an option.

And yes I have tried many things, setting only supported resolutions, waiting several frames to many seconds for it complete. Trying to move the window the correct display.

This is being launched from Steam if that may have any impact on it.
The other two modes work as expected and documented.

Seems like many of the issues are driver related. What’s your GPU and do you have the latest drivers and unity versions?

While I do agree that the usage of fullscreen could be improved, it needs to be reproducible if they are going to make a fix for it.
So if you got something which is (mostly) reproducible you can make a bug report for that

I updated my drivers but no change.
I have a 3080 running nvidia drivers, windows 10.
Unity 2021.3
Aorus FV43U, Dell U3011 and Dell U2410 monitors.
The primary is the FV43U.

After doing some more testing it seems that certain resolutions cause it and others do not.

Even though they all come from the screens list. Appears its the same list in unity as the Nvida control panel.
Changing them in the control panel is smooth but even the ones listed there do not always match what the monitor switches too. So it could be somewhat related to my monitor.

The resolutions that work, work like I would expect. A quick black screen flash and comes back.
The others do that weird dance that takes several times to get back into the app.

I found this

And have been writing these player prefs values after changing. It seems to help on startup of the app.
And when it fails it doesn’t revert back to other resolutions.

Also other weird things one the strange resolutions seems like the app is on the screen but does not have focus. If you interact with it it minimizes.

For now I just limit the number of resolutions. Will be doing some more testing on other computers soon to see as well.

Will probably update to latest unity as well.

Please make a bug report with some resolutions that caused issues and attatch this post as well

Fullscreen Exclusive no longer exists as of DirectX 12. The behaviour you noticed where the application is entering Fullscreen Windowed (FSE) and locking the cursor is known as Emulated Fullscreen Exclusive (eFSE) and exists to maintain backwards compatibility.

https://stackoverflow.com/questions/66134879/is-fullscreen-really-better-than-windowed-mode-in-a-direct3d-12-application/66144592#66144592
https://walbourn.github.io/care-and-feeding-of-modern-swap-chains-3/
https://devblogs.microsoft.com/directx/demystifying-full-screen-optimizations/

Thanks for the links. I will keep reading them.
I am assuming the enhancements for borderless mentioned in the dx blog should apply to dx11 on windows 10?

Also the SO post mentions specific apis. In this current game I am mostly worried about streaming capture vs overall frame rate.

but looking around I have found mention of borderless not being able to do some hardware encoded capturing. Gsync and vrr may not work as expected.

playing other non unity games I think I actually have noticed vrr/gsync not working as expected in borderless modes. And may require vsync turned off.

while our game will perform fine with borderless. I was mainly worried about issues with capture feature not being enabled in a borderless setting.

I had also thought about just leaving the resolution in exclusive mode at native. And then trying to use some of the other scaling manager? For dynamic resolution or the display.setrenderresolution?
But the set render resolution is not implemented on windows standalone.

and the dynamic scaling of render targets didn’t appear to work by just enabling it on the cameras. And controlling it through code. But I did not spend a lot of time to try to make it work.

I am also using the built in renderer for this project. so the urp scaling isn’t available.

In general, exclusive mode doesn’t really have any benefits over fullscreen window mode in recent Windows 10 versions (ones released in the past 5 years or so). However, we still support it as it might be useful for people on Windows 7. If you could report these as bugs, we’d definitely take a look.

All those Fullscreen Window drawbacks went away when we switched to flip model swap chain back in 2019.3. DXGI flip model does not work well with exclusive fullscreen, so we only use it when rendering in windowed and fullscreen window modes.

Which exact version of 2021.3 are you on? This sounds suspiciously like a bug I fixed several months ago.

The only reason I can think of why that might be the case would be if they used older Unity versions (before 2019.3).

2021.3.1f1 was the version.
I have since update to 2022.1.19f1

I have not had time to revisit the issue. I switched the default back to borderless after these discussions.

The game I noticed the issue in was Hunt: Showdown. On the Cryengine. If you do the borderless with vsync on it is really laggy and bad frame rate. Turning it to full screen its fine (100+fps at 144hz refresh).
I tried last night and switched back to borderless and turned off vsync. And it is basically the same now fps as before.
Its not a unity game obviously but I think I have seen this in other ones as well.
So there are still some differences in modes at least related to vsync and VRR.

I was actually fine with not including it. But I was researching and a lot of other games forums etc and everyone was complaining if it wasn’t there or borderless wasn’t there. So was mostly wanted it there to avoid that.

I will see if I can find time to maybe make a repo project to post as a bug.

Thanks for all the inputs and new knowledge.

I think it’s important to recognize that these kind of issues generally happen due to multiple reasons and it’s not as simple as “because it’s borderless”. At least in case of Unity, I’d expect borderless mode to run better than exclusive fullscreen as it utilizes newest Windows presentation technology (whereas exclusive fullscreen is stuck in 2009).