Hello everyone.

We have decided to phase out the Mixed Reality Forums over the next few months in favor of other ways to connect with us.

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.

The plan between now and the beginning of May is to clean up old, unanswered questions that are no longer relevant. The forums will remain open and usable.

On May 1st we will be locking the forums to new posts and replies. They will remain available for another three months for the purposes of searching them, and then they will be closed altogether on August 1st.

So, where does that leave our awesome community to ask questions? Well, there are a few places we want to engage with you. 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. And always feel free to hit us up on Twitter @MxdRealityDev.

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

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

  • 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!

  • 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 ?

  • 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).

  • @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.