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: Differences and Shortcomings

Hey guys,

I spent the last several weeks developing Hololens Apps using Unity. I am now planning to start developing a large long-term project with lot's of functionalities and I am not sure whether to do it in Unity or DirectX for UWP.

Can somebody explain the differences between the two approaches? Are there things that one can do with DX UWP but not with Unity? Or vice versa?
I imagine that by using Unity, you limit yourself in terms of flexibility and will eventually come to the limitations of the platform. Is that true?

Some of the functionalities I want to support include:

  • Everything from the Microsoft Holographic Academy
  • 1D and 2D Marker tracking (Barcode, QR)
  • OpenCV library integration (using the whole native OpenCV library functionality)
  • 3D Object recognition, Text recognition
  • Saving and opening room models, communication with other devices, general network communication
  • and several other things

Disregarding the programming overhead in DirectX, is it possible to do those things using both approaches?

Thanks a lot,
Kev

Best Answers

  • Options
    Answer ✓

    The simple answer is yes. You can do all these things using both Unity and DX.

    Can somebody explain the differences between the two approaches? Are there things that one can do with DX UWP but not with Unity? Or vice versa?
    I imagine that by using Unity, you limit yourself in terms of flexibility and will eventually come to the limitations of the platform. Is that true?

    Unity - you get a GUI editor, store assets, Physics engine, Spatial Audio, Toolkit, community libraries and Mono.Net scripts to write your own code (You know this already). You just have to overcome whatever Mono limitations you may run into.

    DX - no GUI Editor, no store assets, basically any C++ library is at your disposal however you may find things that just don't work in WinRT/UWP. You can create your own Physics engine, or use anyone in the collegiate field you have a choice - but then again not all features may work in UWP. Audio, Toolkits are included as apart of UWP. You write your code in C++/CX or C++ WinRT.

    As far as approaches, I like to think of it like this:
    1. Unity is like a Visual Front end to designing a game like experience - build your POC, idea quickly, and if it leads to something financially continue using it.
    2. DX is a complete platform, If you have an enterprise application, or a integrated solution (i.e. IOT like connecting a RFID scanner to a device which communicates to HL), go through your normal Dev Cycles. If you need to re-use industry standard engines (Physics, Digital Signal Processing, Other things not thought of yet) then DX is the way to go.

    I'd say you're limiting yourself only by way of your creativity. I don't think there's anything you can do in one you can't do in the other. It might take you longer to implement it, but it's all doable. For example, capturing the microphone audio from the device, and sending it to a service, might take you some time with Unity, trying to find the correct libraries, yet there are numerous examples in C++/CX. Yet importing 3D Meshes/Models from other tools are easy as heck in Unity, compared to DX. Both of the scenarios are doable.

    I think if you have the stomach to understand DX and C++, then go for it. Otherwise if you don't have the time and need to get something out the door as fast as possible, then the only possible solution is Unity (Unless you have a cookie cutter DX template already handy, and even then I'd beg the difference)

    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

Answers

  • Options
    Answer ✓

    The simple answer is yes. You can do all these things using both Unity and DX.

    Can somebody explain the differences between the two approaches? Are there things that one can do with DX UWP but not with Unity? Or vice versa?
    I imagine that by using Unity, you limit yourself in terms of flexibility and will eventually come to the limitations of the platform. Is that true?

    Unity - you get a GUI editor, store assets, Physics engine, Spatial Audio, Toolkit, community libraries and Mono.Net scripts to write your own code (You know this already). You just have to overcome whatever Mono limitations you may run into.

    DX - no GUI Editor, no store assets, basically any C++ library is at your disposal however you may find things that just don't work in WinRT/UWP. You can create your own Physics engine, or use anyone in the collegiate field you have a choice - but then again not all features may work in UWP. Audio, Toolkits are included as apart of UWP. You write your code in C++/CX or C++ WinRT.

    As far as approaches, I like to think of it like this:
    1. Unity is like a Visual Front end to designing a game like experience - build your POC, idea quickly, and if it leads to something financially continue using it.
    2. DX is a complete platform, If you have an enterprise application, or a integrated solution (i.e. IOT like connecting a RFID scanner to a device which communicates to HL), go through your normal Dev Cycles. If you need to re-use industry standard engines (Physics, Digital Signal Processing, Other things not thought of yet) then DX is the way to go.

    I'd say you're limiting yourself only by way of your creativity. I don't think there's anything you can do in one you can't do in the other. It might take you longer to implement it, but it's all doable. For example, capturing the microphone audio from the device, and sending it to a service, might take you some time with Unity, trying to find the correct libraries, yet there are numerous examples in C++/CX. Yet importing 3D Meshes/Models from other tools are easy as heck in Unity, compared to DX. Both of the scenarios are doable.

    I think if you have the stomach to understand DX and C++, then go for it. Otherwise if you don't have the time and need to get something out the door as fast as possible, then the only possible solution is Unity (Unless you have a cookie cutter DX template already handy, and even then I'd beg the difference)

    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

    @Dwight_Goins_EE_MVP Thanks for the detailed explanation. I think at the time, Unity is probably the right way to go.

Sign In or Register to comment.