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.

DirectXTK compatibility, Draw() convenience method?

edited October 2016 in Questions And Answers

I'm building Hololens apps in C++/DirectX. These are business MVPs (not gaming) where my clients do not use Unity at all and have a much greater likelihood of already having in-house C++ talent. The github Windows-universal-samples holographic examples in C++ so far have been perfect for my use case.

I'm looking to quickly build UI elements in C++, majority of which are either menus/buttons or existing meshes/obj/models. Building texts, quads, and basic shapes has been no trouble.

Right now I'm working with meshes, and most DirectX examples I can find are either based on DirectXTK or its predecessor XNA. The basic helpers like SimpleMath work fine, but it seems the Effects, Model, and Model.Draw make assumptions that don't work in Holographic. I'm finding very few complete working DirectX examples in C++ or C# that can be easily ported to Holographic.

I understand there are good reasons for the complexity of the Holographic render pipeline, however my clients could care less about shaders or lighting, they just want a POC that their team could reasonably build out.

In short I'm looking for convenience methods like DirectXTK's Model.Draw(). Something I can reuse to prototype concepts that is 'good enough' to start.

  • How much of DirectXTK can I expect to work on Hololens?
  • Are there any similar tools/libraries for convenience that work on Hololens?

Many thanks in advance for any feedback.


Best Answer


  • I am following the same path: DirectX vs Unity.

    I have discovered all of the issues presented here, and many more. DirectXTK is a good place to look at how things are done. As stated,it does not work due to the way shaders need to be set up. It is targeted for a very specific purpose.

    The non-MS GitHub repros are interesting to read. (Some don't build, but reading code is fun.)

    I have found that rolling my own is the path needed.

    • mesh/object loading
    • scenegraph
    • Gaze Cursor
    • Environment interaction (spatial mapping, i/o, etc)

    The biggest issues I have are related to simple services.

    • Why can't I write a file picker?!

    Regardless of the limitations, it is still a new world to develop for. Everything I have learned about developing and shipping Win/OSX/Mobile and UX is out the window. Have to figure out new approaches to what we consider simple problems. The technical side - DirectX, file io, etc - is just that. Solving the UX and interaction problems is the hard work.


  • Thanks @Dwight_Goins_EE_MVP , that's a great start. If I do add Holographic features to any other classes I'll make sure to submit a PR. Looks like a decent amount of work though!

    @pch how are you implementing mesh/object loading? I too need a file picker, what's the limitation?

  • Jimbohalo10Jimbohalo10 ✭✭✭
    edited October 2016

    @doublerebel said:
    I'm building Hololens apps in C++/DirectX.

    I'm finding very few complete working DirectX examples in C++

    Vuforia 6 UWP and UWP samples VuMark are written in C++
    Download for UWP. Build using Visual Studio 2015 update 3 C++
    These run as Windows Store apps. The package is 8.71Mb compressed and its serious package to build.

    You may still need to follow the recommendations in my discussion
    Vuforia Manual - Working with the HoloLens Sample in Unity which I used to build UWP C++ Windows Store version using a USB WebCam

    So next look at the HoloToolkit Sharing, where the code is given in C++ and C Sharp plus Java wrappers are supplied to connect HoloLens devices together.

    Vuforia Early access HoloLens VuMark samples use the Unity HoloLens Toolkit in C Sharp, but can be used in Visual Studio Windows Store UWP.

    Finally there is the most basic DirectX Locatable camera in DirectX
    C++ DirectX programmers will probably easily understand this.
    Unfortunately this seems to be the only real example on talking to the camera/HoloLens Webcam in C++ and UWP.

    I mainly convert from C++ to C Sharp UWP, its not easy and using the
    "unsafe" function to replace byte *, does not seem an easy replacement to me. The Windows Store checker will prevent many API calls, they consider unsafe.

    Vuforia appears to do all its DirectX calls from inside their proprietary Vuforia.DLL, so may be a problem for business use, due to licensing costs

  • I faced this problem at one point myself. I actually have been developing and still am developing an entire C++11 based UI framework for the holo lens. (It's actually more general and targets 2D & VR across all platforms). It currently runs on top of Open GL by using a special fork of ANGLE. I plan to eventually license and release the library and make it available for people to use. For more info, check out #vertoui on twitter.

  • @doublerebel said:
    @pch how are you implementing mesh/object loading? I too need a file picker, what's the limitation?

    I load the mesh and parse it. I wrote (writing) the appropriate shaders to do what I need.

    It is a divide and conquer task.

    Wrt file picker limitation ...

    One Drive is the only available file picker. Can't connect another one in currently, and even then you end up with the XAML code that switches out of Holographic mode.

    For my work, in have a server (Node JS based) that provides the file/stream data, so I am forced to build my own with DirectX.


Sign In or Register to comment.