Hello everyone.

The Mixed Reality Forums here are no longer being used or maintained.

There are a few other places we would like to direct you to for support, both from Microsoft and from the community.

The first way we want to connect with you is our mixed reality developer program, which you can sign up for at https://aka.ms/IWantMR.

For technical questions, please use Stack Overflow, and tag your questions using either hololens or windows-mixed-reality.

If you want to join in discussions, please do so in the HoloDevelopers Slack, which you can join by going to https://aka.ms/holodevelopers, or in our Microsoft Tech Communities forums at https://techcommunity.microsoft.com/t5/mixed-reality/ct-p/MicrosoftMixedReality.

And always feel free to hit us up on Twitter @MxdRealityDev.

UWP Build Type - D3D vs XAML

--- creating new thread after being told my place :( ---

@ahillier so besides being able to invoke the system keyboard, in what other scenarios would it be appropriate to set the "UWP Build Type" setting in Unity to XAML?

There was a post in another thread asking if we could, and if so how to manually make the programmatic switch in our apps between the 3D Volumetric mode and the 2D Xaml mode from within Unity, but I was unable so far to find any more information on either that specifically or on the details on when to use a UWP Build Type of D3D vs XAML and the benefits of each.

Windows Holographic User Group Redmond

WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
WinHUGR YouTube Channel -- live streamed meetings



  • Options

    I have not used the system keyboard in any of my applications, so I have always built with D3D. However, I'll ask this question to our larger team to see if anyone has more information to share.

  • Options
    Worst case, if you need a keyboard you should be able to easily create one in code. It should be a fairly simple endeavor. See what text field is active when the keyboard is called, and have UI buttons for each char. I've considered this approach myself as I just need a num pad for a lot of my entry.
  • Options

    Invoking the keyboard actually didn't prove to be a problem. I have posted simple code that does that while trying to help someone else.

    Given that there are these two build options of "D3D" and "XAML", I am just trying to dig a little deeper to understand the potential of each of those two options.

    I am guessing which option you choose makes a difference or someone wouldn't have bothered exposing them both. I am also guessing it is not a clear cut case that we should always use one (say "D3D") over the other, or the tendency would have been to just force that option and ignore the edge case... unless it was an important edge case (like providing access to the system keyboard perhaps, but I just wanted to double check if there was more to it).

    But yeah, if all one needed where a num pad I agree the DIY route might be a good simple option that you could customize however you wanted and more closely target a particular experience.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

  • Options

    HoloLens supports the UWP view switching API. See here:

    XAML views are always 2D and are placed in the mixed world. You can use them however you like, and we are interested to see how you use them. We currently provide a built in helper secondary view to display a keyboard from a Unity app.

  • Options

    Hi @alfarchy,

    I am familiar with the multiple view window support of UWP and as mentioned in another thread and have had some success with using that functionality with one of our own solutions in a HoloLens 2D app. (except for the UWP threading issues encountered with binding to a single shared ViewModel)

    I am also familiar with displaying the keyboard from within a HoloLens Unity 3D app when the UWP build type flag is set to XAML as mentioned earlier in this thread where I spoke of the sample code that I posted for another user to show them how to do that.

    However, the main purpose of this thread, as the title implies, is to inquire about the differences between building a HoloLens Unity 3D app with either the XAML or the D3D flag.

    As I understand it so far, the XAML flag supports showing the 2D Keyboard by switching between the default 3D volumetric view of the HoloLens Unity 3D app and the 2D XAML view required to show the keyboard.

    Based on your statement that you are using the UWP applicationviewswitcher api to achieve this in a HoloLens Unity 3D app, it sounds like a Unity 3D XAML app has a main app window with some sort of 3D Unity viewport in it?
    And your helper switches between that main UWP XAML app window (that contains some form of 3D Unity view control) and a secondary UWP XAML window that contains the keyboard?
    If that is the case, can we (and if so how) use the same technique in a HoloLens Unity 3D app to switch back and forth between the main UWP XAML app window (that contains the volumetic 3D unity view) and our own custom secondary UWP XAML windows?

    Getting back to the main purpose then of this thread... it sounds like the fundamental difference between picking D3D vs XAML for the UWP build type of a HoloLens Unity 3D app is whether or not the main app window that host the Unity 3D volumetric view is in a barebones Direct3D window or if it is hosted inside a XAML main app window?

    • giving a slight performance advantage to the D3D option
    • also making the solution a little lighter weight for D3D since it doesn't have any XAML wrapper (so to speak)
    • but the D3D option would not support the use of the applicationviewswitcher api and therefore does not support your helper to display the system keyboard
    • and the D3D option would also not support custom XAML secondary windows (if indeed there is a way that we can write our own helpers or use an api of some sort to switch between the main Unity 3D volumetric view and our custom XAML secondary views similar to how your helper does for the keyboard

    Am I understanding that correctly?

    Looking inside the app.xaml.cs and mainpage.xaml.cs of a Unity 3D UWP XAML app I see evidence of some apis that may be related. Is there a specific example available or some guidance that would show how I could correctly go about adding and switching to my own custom XAML 2D pages from within a Unity 3D UWP XAML app and then switch back to the 3D volumetric view as needed?

    Is the code that invokes the built in helper that accesses the keyboard secondary view available as a sample somewhere?

    Sorry for the overly long post, but I hope it provides the necessary clarity.

    Windows Holographic User Group Redmond

    WinHUGR.org - - - - - - - - - - - - - - - - - - @WinHUGR
    WinHUGR YouTube Channel -- live streamed meetings

This discussion has been closed.