One X support in UWP

Hello! Its great that Unity now supports One X in XDK.

Does Unity UWP supports Xbox One X? What Unity version we need for that? Do we need to tune something to support 4K and HDR?

As far as we know, there are no issues with UWP support in Unity and Xbox One X. 4K is supported on all Unity versions on UWP (just because on PC you had 4K since forever), but we do not support HDR today.

What will happen currently if someone runs a Unity UWP app on an Xbox with a 4K screen? Will the game just run at 4K resolution? If so, is there a way to force 1080p instead?

Original Xbox One and Xbox One S cannot output resolutions higher than 1080p afaik, so they will default to that. Xbox One X will default to 4k if appropriate screen is connected.

Unless I’m mistaken, UWP on Xbox One X is rendered at 1080p (with or without Unity). I have been attempting to get a UWP app to run at true 2160p.

If I check the UnityEngine.Screen.Width property in a script at runtime, on the Xbox One X it returns 1920. Attempting to change the resolution using UnityEngine.Screen.SetResolution(3840,2160,true) doesn’t seem to work when done in a script, and crashes the app when done directly in the VS project built by Unity.

Please bear in mind I know almost nothing about Unity or UWP, I am literally just seeing if I can get an app (of any kind!) that I’ve written, running on the One X at 4k. So far, I haven’t had any luck. If any of what I’ve said makes no sense, is misguided, or plain wrong, please let me know and if possible, point me in the right direction.

Otherwise, if it is really a limitation of UWP itself, and the One X is always seeing a 1080p resolution despite the system actually running at 2160p, then we’ll have to wait for Microsoft to update UWP support on the One X to support true 4k.

Any thoughts/assistance would be greatly appreciated!

The crash when you do it from VS project is probably due to calling that API from the wrong thread. Let me see if I can find out more information about rendering 4k on UWP on Xbox One X.

2 Likes

I have an Xbox One X hooked up to a 4K TV.

I haven’t played with UWP deployment to it yet but I noticed that the “Developer Mode” app automatically installed when I setup the console.

When I get some time this weekend, I’ll deploy a test Unity UWP app using the Advanced FPS Counter asset, which will display the detected full screen resolution.

I’ll post a screenshot here with the results.

I’m currently working on 4k integration for our game and can not confirm, that 4k on an Xbox One X with the appropriate screen will work out of the box.

My setup:
Unity 2017.6.f1 (2017.4.2f2 before)
Building for UWP, build type: D3D
SDK 10.0.17134.0, VS 2017
IL2CPP backend,
Scripting Runtime Version .NET 4.6 Equivalent,
API compatibility Level .NET 4.6
Xbox One X Dev Kit w/ OS version 10.0.17134.3036

When starting the game it displays at 1080p
Logging Screen.resolutions gives me this:
Available resolutions:
1920 x 1080 @ 0Hz
2880 x 1440 @ 0Hz
3840 x 2160 @ 0Hz

I can switch to 4k by calling Screen.SetResolution(3840, 2160, true) what outputs
Resolution: Switching to 3840 x 2160 Fullscreen: True
Resolution: ApplicationView::IsFullScreenMode = True
Resolution: Resizing swapchain to 3840 x 2160 Fullscreen: True
Resolution: Done.

But when I log this Debug.LogFormat("Current res: {0}; Width x Height: {1} x {2}", Screen.currentResolution, Screen.width, Screen.height) I get:
Current res: 1920 x 1080 @ 0Hz; Width x Height: 3840 x 2160

This seems like a bug and also UI elements aren’t reacting properly to clicks - I can only click on the left half (full height tho), but nothing right of the imaginary middle line. Simmilarly if I set the resolution to 2880 x 1440, I can only click on elements on the left 2/3rds of the screen, but not on the right 3rd (full height clicikable again).
This behavior also persists after unloading and loading scene again.
The UI elements I’m talking about are on a Canvas (Screen Space - Overlay) with a Canvas Scaler (reference resolution: 3840x2160; Screen Match Mode: width/height; Match: 1 - height) and it works as expected on any other platform.

Also interesting is, that p.e. the Development Console will shrink in size (as expected on a higher resolution), but the font is very jagged - not smooth at all). The game seems to be in a strange mixed state between 1080p and 4k.

EDIT: Doing some closer inspection/ comparison with the PS4 version:
It seems, that when I set the resolution to 4k, Unity internally renders everything in 4k, but ultimately when rendered to the screen it seems to be displayed in 1080p. The render quality of the textures slightly increases, but it’s by far not as crisp and detailed as it should be.

Is there something I might do wrong, or is this a bug/ the lack of 4k support on UWP?

Looks like I forgot to follow up on this from my prior post.

When I tested 4K support with my Xbox One X in January, I could not get it to work.

The same test UWP app worked fine in 4K on my PC but would render in 1080P on my Xbox One.

I seem to remember adding code to explicitly set the resolution to 4K, which also worked on my PC but not on my Xbox.

I think I have some screenshots on my phone. I’ll try to dig them up.

I know that since then, Microsoft has increased the system resources available to UWP apps on Xbox One.

So, it’s possible that something changed in this regard.

I’m currently in the middle of re-arranging my work space.

I’ll try to do some more testing of this in the next few days.

Edit: I’ve uploaded a screenshot from my testing at the time (the blue dot on the bottom left is my TV’s power/status LED).

I have another screenshot (that I didn’t upload) that shows that my TV was in 4K mode, even though the UWP app was reporting 1080P.

So it must have been running in 1080P internally and being upscaled to 4K resolution outside of the UWP sandbox.

Again, these tests were done prior to Microsoft expanding the resources available to UWP on Xbox One. I’ll do some more testing on this issue soon.

Thanks for sharing your findings! I’m afraid, the 1080p cap is still happening tho!
Is your test app a native written app, or through Unity? I’ve not yet managed to get the TV resolution, other than listing Screen.resolutions - which may be the same values regardless of TV?

This seems not to be the case unfortunately. (At least not as UWP)

In my case the game crashed b/c it had too little resources (I guess b/c of the bigger frame buffers needed) when I set a higher resolution. With the expanded resources this now works w/o any problem - I haven’t mentioned that in my other post. Here’s how to do that: https://forum.unity.com/threads/uwp-xbox-one-poor-performance-enhanced-access.504884/#post-3312304

My findings were, that you can internally switch the resolution in Unity (manually), but on the screen it still shows up rendered at 1080p (see post above). Is this a limit of Unity w/ UWP or a limit of UWP itself?

I’ll ask Microsoft about this. Unity doesn’t handle this in any special way - it just resizes the DXGI swapchain to the size you requested.

1 Like

It’s a Unity app. I use the Advanced FPS Counter asset to get the device/resolution info.

Here’s a screenshot of how it looks If I display a 4k testimage on the xBox w/ a 4k display. This is a UWP game built with Unity:
3558757--286606--Testimage in action.png
Here’s the original image:
3558757--286605--4K Test Image.png
Either display them fullscreen on a 4k display or zoom in to 100%. The test image contains interleaved black and white pixels and on the Xbox One X dev kit with a 4k resolution set it’s just sold gray - not rendered in 4k.

is it a bug of the Unity Input System then, that I can only click buttons on the left half of the screen if I Screen.SetResolution(3840, 2160)? The full height is clickable, but right side cut off at 1080 pixels.
It’s a full screen Canvas, that resizes with the height. See my original post:

Possibly. Can we get a bug report on this?

Filed a bug with a detailed repro project: Case 1059813

Thanks, we’ll take a look.

1 Like

EDIT: THIS IS WRONG - SEE POST BELOW Meanwhile, I asked in the Xbox Developer Forums about UWP games and 4k resolution and this currently is NOT supported on the Xbox One (X/S).

Still Unity can internally render in 4k when using Screen.SetResolution(). This slightly increases the quality, but the UI event system is confused.

I’ll also add this to the bug report.

2 Likes

OK, just received a message, that this info was wrong! UWP games can in fact render in 4k, but not in 4K HDR (which we don’t use). This was where the confusion about the feature came from. I was given this link with more details about the capabilities:
https://blogs.msdn.microsoft.com/chuckw/2017/12/15/directx-and-uwp-on-xbox-one/

Now the question stays, why Unity doesn’t properly switch into 4K at startup, nor does it behave correctly when the resolution is set, or if there are any workarounds for this problem.

We’re very close to submitting a build to cert, so it would be awesome if we can tackle this somehow!

Kind regards,
Jan

1 Like

My project is also interested in 4K support on UWP.

The blog post in the previous thread has details on how to set up the swapchain for this on the Xbox One X. But it sounds like Unity doesn’t support doing that.

If Unity has (or adds) support for out-of-the-box 4K support on UWP apps running on Xbox One X, my team would also be very interested in this feature!