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.
Options

Using XAML in Holographic Space

Hi,

I'm currently trying to add some user interface into my Holographic application.
My whole application is written with DirectX and I won't use Unity.

The app main feature is to display a 3D Volume in the Holographic space and interact with gesture such as rotation and translation.

An idea to improve the interaction, is to create some floating windows, to add advanced manipulations, and features.

In a perfect world I would like to draw in my floating windows (which would be floating plane, or billboard) an interface written in XAML or directly renderer by some Windows.UI.XAML.UIElement.

So basically I want to renderer XAML Element into a Texture2D, and I tried to do the following :

await CoreApplication.MainView.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, async () => { RenderTargetBitmap renderBitmap = new RenderTargetBitmap(); await renderBitmap.RenderAsync(PanoramicImage); XamlPixel = await renderBitmap.GetPixelsAsync(); });

The problem is, RenderTargetBitmap.RenderAsync is blocking undefinitly, and I'm not able to reach the GetPixelsAsync function.

This is a similar problem than this thread.

Do you guys have any idea ?

Thanks in advance.

Answers

  • Options

    @Simon, @AdrianWenz I saw you had a similar problem. Did you find any solution ?

  • Options

    Unfortunately not.
    But why not preparing the floating windows content (i.e. the various Texture2D's) in advance (manually) and jump directly into 3D volumetric view? I guess, as the window content is meant to be some kind of help, there won't be too many (Texture2Ds) to prepare and they do not need to have changing (dynamic) content.
    Good luck!

  • Options

    Thank for your response.

    That won't work for me, because I want a dynamic content (drawing histogram). But yes for some static element it could work.

    Do you know if I could use an exsiting library for drawing UI in UWP app, instead of implementing myself a UI system with Direct2D ?

  • Options

    I have a (commercial) UI library available but it uses an OpenGL rendering system. See my other post in projects. The good news here is you can grab the underlying D3D11 context to do manual rendering yourself, but it wasn't the intended usage of the engine (the intended usage was to use OpenGL most of the time and D3D very occasionally).

  • Options

    @Barklight said:
    @Simon, @AdrianWenz I saw you had a similar problem. Did you find any solution ?

    Yes, the steps I outlined here work for rendering the WebView control. I know that doesn't help you if you want other XAML controls, but since you seem to be open to any general UI system, you should consider using HTML for the UI anyway (that's why I used it); it's pretty easy to prototype/iterate quickly on your desktop (WebView is based on Edge, so I used that for testing) and there are lots of cool JavaScript libraries like D3 that sound like they would be useful to you.

    There are a couple of drawbacks with this approach though; there'll be a bit of work involved with getting it up and running and you won't get a fantastic frame rate on the texture (maybe a few/several frames a second). However, if you don't need smooth animation and it's worth the work, it might be a good option for you.

Sign In or Register to comment.