How to support multiple displays UWP

I need to develop an augmented reality application using vuforia, and now that it supports UWP I think is possible to use this library for a windows pc application, but when I change my unity project for windows store on build settings I notice that multiple displays support doesn’t appear to be found. My application needs to be displayed on two monitors where on one monitor is the augmented content and on the other is some kind of gui interaction.

So my question is how can I support multiple displays in UWP

Unfortunately there is no built in way.

You could theoretically create a new CoreApplicationView, create a new swapchain for that, render all your stuff of the second monitor to a render texture in Unity, then call GetNativeTexturePtr on it and then blit it to the second window swapchain.

I haven’t tried this, though.

Ok, It is sad that this can’t be done in a built in way, I will try the other method that you mention, just I need to investigate a little further on how to do what you mention.
Thanks for the tip.

Are you sure? How about https://docs.unity3d.com/Manual/MultiDisplay.html ?

That option from what I see is just for stand alone build, not for UWP

Continuing discussion from here:

So what exact difficulties are you running into?

I’m trying to use this as example http://www.informit.com/articles/article.aspx?p=2304072&seqNum=2 but without success.

On the MainPage.xaml.cs file I’m trying to implement this like on the link mention, but I don’t know how to pass the texture of the camera to this new window. Maybe I’m doing this wrong, maybe I need to compile first a plugin with this new windows and then on unity import it and pass the texture to a method that has this new window.

But I’m not sure how to proceed, I tried to search on the web for examples and tips but without success.

You don’t pass a texture to that function. You need to first create a window, then create a swapchain for it using this:

And finally, blit to the said texture every frame, probably using this:

You don’t need to do any of this from MainPage.xaml.cs. Easiest way would probably be a C++ plugin.

ok, thanks I will check the links you provide.
This is the first time I try to develop a plugin for unity, so it will be a little challenging but I hope is not that hard.

Unfortunately it seems this is still an issue with more modern versions of Unity & Windows MR: Multiple Displays using UWP and Windows Mixed Reality - Questions & Answers - Unity Discussions

Any luck with this?

We’re trying to achieve something similar using UWP and clever graphics API tricks to Run a single unity instance against a number of windows.

Edit: Research is ongoing but looking promising. Currently working on resource sharing between the Unity Direct3D Device and the Windows Direct3D Device. Should be possible in theory.

1 Like

Solved for me, I bought and used this plugin:
https://www.republicofhandball.com/assets/

Long and short of it, this is a native C++ plugin which does the following:

1 Like

I’m already using a native rendering plugin in my application and I’m not sure there’s any way to insure the order of the plugin callbacks but perhaps it’s just simply FIFO based on the order of the GL.IssuePluginEvent calls?

Check out the latest release: Unity Assets
On MacOS it has support for Metal (as openGL has been removed)