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

Unity vs DirectX performance

Hi all,

I have been researching HoloLens development for a while now. I noticed there are two different ways of developing for the HoloLens, Unity and DirectX. However, none of the sources speak about performance of Unity compared to DirectX. Does DirectX development allow for more performance due to less overhead of the Unity game engine?

Some sources I found:

And if DirectX programming allows for more performance, is it worth the trouble? (Of course it depends on the type of application also) I have done some OpenGL programming in the past, but never DirectX (neither have I programmed in Unity before).
I am not exactly sure of the application I am going to create, but it probably involves the rendering of 3D CAD models.

Thanks,
Bram

Tagged:

Best Answers

  • Options
    Answer ✓

    Hi @Barmyard,

    DirectX is the closest code you can get to the metal with Holographic development, and to be specific C++/DirectX. What I mean by this is as far as performance is concerned, C++/DirectX will have the least layers/frameworks which usually means better performance.

    However this is not always the case, performance is based on many aspects as you point out in the articles above. A Holographic application has many points of contention where performance can be an issue. Shaders, Custom Logic, Physics, Spatial Sounds, Voice Recognition, Gaze, Gestures, RAM, latencies (such as network) and the list can go on and on.

    The HL Team has built multiple showcase applications for the HoloLens using Unity as the development platform, One such application is the Galaxy Explorer and they have made conscious decisions for performance especially when attempting to display thousands of stars in the galaxy.

    It has been explained to me that you can get good performance for the most complex type of application using Unity, and it is an adequate platform.

    As far as DirectX, you can clearly get the best performance because it's less levels of indirection but at the cost of development time. Here's a good video of general DirectX performance vs XAML

    I stress, the development experience is not the same. I'll give you an example, For a person with no Unity experience, they can get a cube spinning in mid air with your own texture in like 1 hour as a tutorial in Unity. Doing the same in DirectX programing, with the same newbie level of expertise will take at least 1 whole day (24 hours) and that's if they don't run into any issues nor give up trying.

    Dwight Goins
    CAO & Founder| Independent Architect | Trainer and Consultant | Sr. Enterprise Architect
    MVP | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer
    http://dgoins.wordpress.com

  • Options
    Jimbohalo10Jimbohalo10 ✭✭✭
    Answer ✓

    @Barmyard said:
    I am not exactly sure of the application I am going to create, but it probably involves the rendering of 3D CAD models.

    Thanks,
    Bram

    Hi Bram,
    There is a article all about Unity 3D model import

    Although you might think the speed of DirectX is important. The vast array of software available in the Unity Asset store will probably bring you round to getting quick results from adapting others work. Importing is easy Import 3D, even dynamically at run time. There are amazing free apps for 3D editing apps KitBash

    Back a while ago I easily converted this converting-unity-5-destroyed-city
    in under an hour and I had only just started Unity/HoloLens then.

    Direct X conversion would take weeks. Well you could do the complex work in DirectX and call your code as a plugin in Unity

    Really what you need to start is a PC with QUAD I5 NVidia GT750 at least 8GB memory or better to run with the Emulator and see how fast the Visual Studio DirectX Holographic template is compared with Unity doing a similar thing. You will find that when built the Unity WSA Player optimises the code very well, better than most people could as it relies on calling highly optimised libraries.

Answers

  • Options
    Jim_SEOWJim_SEOW
    edited October 2016

    For development of HoloLens using OpenGL, please use Microsoft Angle for Hololens

    For demo using Microsoft's Angle4Hololens, check:
    Part 1.
    Part 2
    Part 3

  • Options
    Answer ✓

    Hi @Barmyard,

    DirectX is the closest code you can get to the metal with Holographic development, and to be specific C++/DirectX. What I mean by this is as far as performance is concerned, C++/DirectX will have the least layers/frameworks which usually means better performance.

    However this is not always the case, performance is based on many aspects as you point out in the articles above. A Holographic application has many points of contention where performance can be an issue. Shaders, Custom Logic, Physics, Spatial Sounds, Voice Recognition, Gaze, Gestures, RAM, latencies (such as network) and the list can go on and on.

    The HL Team has built multiple showcase applications for the HoloLens using Unity as the development platform, One such application is the Galaxy Explorer and they have made conscious decisions for performance especially when attempting to display thousands of stars in the galaxy.

    It has been explained to me that you can get good performance for the most complex type of application using Unity, and it is an adequate platform.

    As far as DirectX, you can clearly get the best performance because it's less levels of indirection but at the cost of development time. Here's a good video of general DirectX performance vs XAML

    I stress, the development experience is not the same. I'll give you an example, For a person with no Unity experience, they can get a cube spinning in mid air with your own texture in like 1 hour as a tutorial in Unity. Doing the same in DirectX programing, with the same newbie level of expertise will take at least 1 whole day (24 hours) and that's if they don't run into any issues nor give up trying.

    Dwight Goins
    CAO & Founder| Independent Architect | Trainer and Consultant | Sr. Enterprise Architect
    MVP | MCT | MCSD | MCPD | SharePoint TS | MS Virtual TS |Windows 8 App Store Developer | Linux Gentoo Geek | Raspberry Pi Owner | Micro .Net Developer | Kinect For Windows Device Developer
    http://dgoins.wordpress.com

  • Options
    Jimbohalo10Jimbohalo10 ✭✭✭
    Answer ✓

    @Barmyard said:
    I am not exactly sure of the application I am going to create, but it probably involves the rendering of 3D CAD models.

    Thanks,
    Bram

    Hi Bram,
    There is a article all about Unity 3D model import

    Although you might think the speed of DirectX is important. The vast array of software available in the Unity Asset store will probably bring you round to getting quick results from adapting others work. Importing is easy Import 3D, even dynamically at run time. There are amazing free apps for 3D editing apps KitBash

    Back a while ago I easily converted this converting-unity-5-destroyed-city
    in under an hour and I had only just started Unity/HoloLens then.

    Direct X conversion would take weeks. Well you could do the complex work in DirectX and call your code as a plugin in Unity

    Really what you need to start is a PC with QUAD I5 NVidia GT750 at least 8GB memory or better to run with the Emulator and see how fast the Visual Studio DirectX Holographic template is compared with Unity doing a similar thing. You will find that when built the Unity WSA Player optimises the code very well, better than most people could as it relies on calling highly optimised libraries.

  • Options

    @Dwight_Goins_EE_MVP
    Thank you very much for your extensive answers! It seems to me now that the performance of Unity should be enough. I didn't know that creating your own shaders in Unity is also possible. I am going to work on a master thesis project on my own, so it's better to avoid the use overhead.

    @Jimbohalo10
    Thanks for your answer! It seems to me that Unity will do in my case.

    Awesome community guys, keep it up

Sign In or Register to comment.