To get started building holographic apps with Unity, install the HoloLens development tools which include the Unity HoloLens Technical Preview. The Unity HoloLens Technical Preview is based off of the Unity 5.4 builds. Be sure to check back regularly for updated Unity builds.
The fastest path to building a mixed reality app for HoloLens is with Unity. We recommend you take the time to explore the Unity tutorials. If you need assets, Unity has a comprehensive Asset Store. Once you have built up a basic understanding of Unity, you can visit the Holographic Academy to learn the specifics of holographic development with Unity. Be sure to visit the Unity HoloLens forums to engage with the rest of the community building holographic apps in Unity and find solutions to problems you might run into.
Standard Unity game objects (such as the camera) will work immediately for holographic apps, with the camera's position updated automatically as the user moves their head through the world.
This includes the core building blocks for holographic apps, exposed in a manner consistent with other Unity APIs:
There are other key features that many holographic apps will want to use, which are also exposed to Unity apps:
There is a small collection of Unity settings that needs to be changed for HoloLens, and are broken down into two categories: per-scene and per-project.
If you delete and create a new camera, make sure your camera is Tagged as MainCamera.
For more details about holographic rendering, see the Rendering article.
For an app to take advantage of certain functionality on HoloLens, it must declare certain capabilities in its manifest. The manifest declarations can be made in Unity so they are included in every subsequent project export. The setting are found in Player Settings > Windows Store > Publishing Settings > Capabilities. The applicable capabilities for enabling the commonly used APIs for Holographic apps are:
|Capability||API's requiring capability|
|WebCam||PhotoCapture and VideoCapture|
|SpatialPerception||SurfaceObserver and SpatialAnchor|
|Microphone||VideoCapture, DictationRecognizer, GrammarRecognizer, and KeywordRecognizer|
|PicturesLibrary / VideosLibrary / MusicLibrary||PhotoCapture and VideoCapture (for still photos, video, and audio respectively)|
|InternetClient||DictationRecognizer (and to use the Unity Profiler)|
We need to also specify our Unity project to export as a Universal Windows Platform app.
Finally, we need to let Unity know that the app we are trying to export should create a holographic view instead of a 2D view. We do that by adding HoloLens as a virtual reality device.
In addition to this documentation available on the Windows Dev Center, Unity installs documentation for Windows Holographic and HoloLens functionality alongside the Unity Editor. The Unity provided documentation includes two separate sections: