混合现实开发简介

混合现实涉及面非常广,在这里现实世界和虚拟世界发生碰撞。 可能性是无限的,从你开始。 选择你的引擎,下载你的工具,清理你的键盘。 欢迎来到混合现实生态系统 - 是时候该创建了。
开发选项
Unity - Unity 是市面上领先的实时开发平台之一,其中基础运行时代码采用 C++ 编写,所有开发脚本设置均在 C# 中完成。 无论你是想创建游戏、电影和动画,还是想在虚拟世界中呈现建筑或工程概念,Unity 都有提供支持的基础结构。
Unreal - Unreal Engine 4 是一种强大的开源创建引擎,全面支持采用 C++ 和 Azure 蓝图编写的混合现实。 从 Unreal Engine 4.25 开始,HoloLens 提供完备的支持,且已准备好投入生产。 借助灵活的 Blueprints Visual Scripting 系统等功能,设计师可直观地使用全套概念和功能,而这些内容通常仅适用于编程人员。 跨多个行业的创建者可利用自由操作和掌控力来提供前沿内容、交互式体验和沉浸式虚拟世界。
原生 (OpenXR) - OpenXR 是来自 Khronos 的开放式免版税 API 标准,它对供应商提供的涵盖广泛的混合现实的各种设备提供引擎本机访问。 你可在桌面上的 HoloLens 2 或 Windows Mixed Reality 沉浸式头戴显示设备上使用 OpenXR 进行开发。 如果你无权访问头戴显示设备,可使用 HoloLens 2 和 Windows Mixed Reality 头戴显示设备的仿真器。
你对哪一技术路径感兴趣?
我们的文档中有几种开发途径供你采用。 首先是找到适合你的技术。 如果你已经有了想法,请继续操作,直接跳到下面其相应的选项卡。 如果你还在观望或者刚刚起步,请查看每一种途径,了解它们提供的内容、可用的平台和工具,然后开始创建吧!
重要
如果你有现成的项目想要引入到 HoloLens 2 或沉浸式 VR 头戴显示设备(例如 Reverb G2)中,请查看我们的移植指南概述。 对于使用 HTK、MRTK v1、SteamVR 或针对沉浸式头戴显示设备开发的项目(例如 Oculus Rift 或 HTC Vive),我们有一些指导。

使用 Unity 构建跨平台、功能齐全的混合现实应用。Build a cross-platform, full-featured mixed reality app with Unity. 请参阅 Unity 开发概述,开始针对 HoloLens 或 Windows Mixed Reality 沉浸式头戴显示设备进行 Unity 开发。See the Unity development overview to get started with Unity development for HoloLens or Windows Mixed Reality immersive headsets.
在使用 Unity 构建混合现实应用时,有几个硬件和仿真器选项供你使用。You have several hardware and emulator options when building Mixed Reality apps with Unity. 虽然我们的开发人员文档侧重于 HoloLens 设备,但你也可在设备支持部分找到关于沉浸式头戴显示设备部署的详细信息(若适用)。While our developer documentation focuses on HoloLens devices, you'll find device support sections with details on immersive headset deployment when applicable.
增强现实设备Augmented reality devices
沉浸式 VR 头戴显示设备Immersive VR headsets
- HP Reverb 和 Reverb G2HP Reverb and Reverb G2
- Samsung Odyssey 和 Odyssey+Samsung Odyssey and Odyssey+
- HP Windows Mixed Reality 头戴显示设备HP Windows Mixed Reality headset
- Lenovo ExplorerLenovo Explorer
- Acer AH101Acer AH101
- Dell VisorDell Visor
- Asus HC102Asus HC102
- Acer OJO 500Acer OJO 500
工具/SDKTool/SDK |
说明Description |
Unity 的混合现实工具包Mixed Reality Toolkit for Unity |
Unity 的混合现实工具包是一个开源的跨平台开发工具包,旨在加快对面向 Microsoft HoloLens、Windows Mixed Reality 沉浸式 (VR) 头戴显示设备和 OpenVR 平台的应用程序的开发。The Mixed Reality Toolkit for Unity is an open source cross-platform development kit built to accelerate development of applications targeting Microsoft HoloLens, Windows Mixed Reality immersive (VR) headsets and OpenVR platform. |
云服务Cloud services
有几种云服务可以集成到 Unity 中内置的混合现实项目中,具体来说,即“Azure 远程渲染”和“Azure 空间定位点” 。There are several cloud services that can be integrated into Mixed Reality projects built in Unity, specifically Azure Remote Rendering and Azure Spatial Anchors. 这些服务可以为应用程序添加共享的全息内容和实时 3D 渲染,使它们对用户更具吸引力且使用户更具有身临其境的感觉。These services can add shared holographic content and real-time 3D rendering to your applications, making them more compelling and immersive for your users.
所有这些服务都涵盖在针对 HoloLens 的 Unity 开发历程过程中,这是强烈推荐的学习 Unity 混合现实的路径。All of these services are covered over the course of the Unity development for HoloLens journey, which is the strongly recommended path for learning Mixed Reality with Unity. 你已走上了此路径,因此只要继续阅读并遵循文章底部的蓝色大按钮进行操作即可。You're already on this path, so just keep reading and follow the big blue button at the bottom of the article. 但是,如果你处于更高级的开发阶段,并且想加入进来,则请查看我们的云服务概述或直接转到服务资源。However, if you're at a more advanced development stage and already know you want to jump in, check out our cloud services overview or go directly to the services resources.
Dynamics 365 GuidesDynamics 365 Guides
可使用 Microsoft Dynamics 365 Guides 直观地将全息说明绑定到应用虚拟环境,从而在需要时随时随地为用户提供重要的信息。You can use Microsoft Dynamics 365 Guides to visually tether holographic instructions to your apps virtual environment, giving your users important information when and where it's needed. 针对 HoloLens 的 Unity 开发历程中也涵盖了此功能,但是如果你想要更进一步了解,可选择此处的“Dynamics 365”选项卡来查看提供的功能。This feature is also covered in the Unity development for HoloLens journey, but if you want to jump ahead you can see what's on offer by selecting the Dynamics 365 tab here.
示例Examples
我们提供了很多开源示例应用,你可下载和使用它们,在 Unity 中体验混合现实的最终产品。We have several open source sample apps for you to download and play around with to get a feel for a Mixed Reality end product in Unity. 还有 MRTK 示例场景供你测试特定功能:There are also MRTK example scenes available for you to test out specific features:
备注
这两个 MRTK 示例场景都需要安装 MRTK Foundation 和示例 Unity 包。Both of the MRTK example scenes require MRTK Foundation and Example Unity packages to be installed.

使用 Unreal 构建功能齐全的跨平台混合现实应用。Build a cross-platform, full-featured mixed reality app with Unreal. 请参阅 Unreal 开发概述,开始针对 HoloLens 进行 Unreal 开发。See the Unreal development overview to get started with Unreal development for HoloLens.
使用 Unreal 引擎构建混合现实应用时,有多个硬件、仿真器和流式处理选项供你使用。You have several hardware, emulator, and streaming options when building Mixed Reality apps with Unreal Engine. 虽然我们的开发人员文档侧重于 HoloLens 设备,但你也可将 Unreal 项目打包为 x64 桌面应用,并在沉浸式头戴显示设备上运行它们。While our developer documentation focuses on HoloLens devices, you can package your Unreal projects as x64 desktop apps and run them on immersive headsets just fine.
增强现实设备Augmented reality devices
沉浸式 VR 头戴显示设备Immersive VR headsets
- HP Reverb 和 Reverb G2HP Reverb and Reverb G2
- Samsung Odyssey 和 Odyssey+Samsung Odyssey and Odyssey+
- HP Windows Mixed Reality 头戴显示设备HP Windows Mixed Reality headset
- Lenovo ExplorerLenovo Explorer
- Acer AH101Acer AH101
- Dell VisorDell Visor
- Asus HC102Asus HC102
- Acer OJO 500Acer OJO 500
工具/SDKTool/SDK |
说明Description |
Unreal 的混合现实工具包Mixed Reality Toolkit for Unreal |
适用于 Unreal 的混合现实工具包 (MRTK-Unreal) 是一组组件,包含插件、示例和文档,旨在加快使用 Unreal Engine 开发混合现实应用程序的速度。The Mixed Reality Toolkit for Unreal (MRTK-Unreal) is a set of components, in the form of plugins, samples and documentation, designed to accelerate development of mixed reality applications using the Unreal Engine. |
云服务Cloud services
在 Unreal 中构建混合现实应用时,你可以访问称为“Azure 空间定位点”的强大云服务,可使用它在不同设备之间添加、保留和共享全息内容。When building Mixed Reality apps in Unreal, you have access to a powerful cloud service called Azure Spatial Anchors, which you can use to add, persist, and share holographic content across different devices.
Azure 空间定位点涵盖在 Unity 开发历程的过程中,这是强烈推荐的学习 Unreal 混合现实的路径。Azure Spatial Anchors is covered over the course of the Unreal development journey, which is the strongly recommended path for learning Mixed Reality with Unreal. 你已走上了此路径,因此只要继续阅读并遵循文章底部的蓝色大按钮进行操作即可。You're already on this path, so just keep reading and follow the big blue button at the bottom of the article. 但是,如果你处于更高级的开发阶段,并且想加入进来,则请查看我们的云服务概述或直接转到服务资源。However, if you're at a more advanced development stage and already know you want to jump in, check out our cloud services overview or go directly to the services resources.
Dynamics 365 GuidesDynamics 365 Guides
可使用 Microsoft Dynamics 365 Guides 直观地将全息说明绑定到应用虚拟环境,从而在需要时随时随地为用户提供重要的信息。You can use Microsoft Dynamics 365 Guides to visually tether holographic instructions to your apps virtual environment, giving your users important information when and where it's needed. Unreal 开发历程中也涵盖了此功能,但是如果你想要更进一步了解,可以通过选择此处的“Dynamics 365”选项卡来查看提供的功能。This feature is also covered in the Unreal development journey, but if you want to jump ahead you can see what's on offer by selecting the Dynamics 365 tab here.
示例Examples
- Kippy 的转义 - Kippy 的转义是使用 Unreal Engine 4 和混合现实 UX Tools(适用于 Unreal)构建的开源 HoloLens 2 示例应用。Kippy's Escape - Kippy’s Escape is an open-source HoloLens 2 sample app built with Unreal Engine 4 and Mixed Reality UX Tools for Unreal. 游戏展示了 HoloLens 2 硬件的独特功能和混合现实 UX Tools 的开发能力。The game showcases the unique features of the HoloLens 2 hardware and the development power of the Mixed Reality UX Tools.

WebXR 设备 API 是一种开放式规范,你可用它在任意平台中通过浏览器来体验混合现实应用。The WebXR Device API is an open specification that allows you to experience Mixed Reality apps in your browser on any platform. 请参阅 JavaScript 开发概述,开始为任何平台构建混合现实应用。See the JavaScript development overview to get started building Mixed Reality apps for any platform.

创建直接针对 Windows Mixed Reality API 的混合现实应用。Create mixed reality apps with a direct line to the Windows Mixed Reality APIs. 请参阅原生开发概述,开始使用 OpenXR 或旧版 WinRT针对 HoloLens 2 或 Windows Mixed Reality 沉浸式头戴显示设备进行原生应用开发。See the Native development overview to get started with native app development using OpenXR or legacy WinRT for HoloLens 2 or Windows Mixed Reality immersive headsets. Windows Mixed Reality API 支持用 C++ 和 C# 编写的应用程序,让你能够在任一语言中构建自己的框架或中间件。The Windows Mixed Reality API supports applications written in C++ and C#, allowing you to build your own framework or middleware in either language.
通过 OpenXR 开发构建混合现实应用时,有几个硬件、仿真器和流式处理选项供你使用。You have several hardware, emulator, and streaming options when building Mixed Reality apps with OpenXR development.
增强现实设备Augmented reality devices
沉浸式 VR 头戴显示设备Immersive VR headsets
- HP Reverb 和 Reverb G2HP Reverb and Reverb G2
- Samsung Odyssey 和 Odyssey+Samsung Odyssey and Odyssey+
- HP Windows Mixed Reality 头戴显示设备HP Windows Mixed Reality headset
- Lenovo ExplorerLenovo Explorer
- Acer AH101Acer AH101
- Dell VisorDell Visor
- Asus HC102Asus HC102
- Acer OJO 500Acer OJO 500
工具/SDKTool/SDK |
说明Description |
OpenXR 开发人员工具OpenXR Developer Tools |
提供了一个演示场景和一个系统状态页,场景中展示了 OpenXR 的各种功能,页面中提供了有关活动运行时和当前头戴显示设备的关键信息。Provides a demo scene that exercises various features of OpenXR, along with a System Status page that provides key information about the active runtime and the current headset. |
OpenXR 规范OpenXR Spec |
介绍什么是 OpenXR、它提供哪些功能和特性,以及如何在你自己的项目中实现它。Describes what OpenXR is, what capabilities and features it offers, and how to implement it into your own projects. |
OpenXR 加载程序OpenXR Loader |
发现设备上的活动 OpenXR 运行时,并提供对其实现的核心功能和扩展功能的访问。Discovers the active OpenXR runtime on the device and provides access to the core functions and extension functions that it implements. |
示例Examples
可随意使用示例应用来体验原生开发和混合现实可能实现的用途。Feel free to play around with the sample app to get a feel for what's possible with Native development and Mixed Reality.
- BasicXrApp - 演示了一个简单的 OpenXR 示例,该示例中有两个 Visual Studio 项目文件,一个用于 Win32 桌面应用,另一个用于 UWP HoloLens 2 应用。BasicXrApp - Demonstrates a simple OpenXR sample with two Visual Studio project files, one for both a Win32 desktop app and one for a UWP HoloLens 2 app.
你还可观看 60 分钟的 BasicXrApp 演练,其中介绍了 Visual Studio 中 OpenXR API 的所有关键组件:You can also watch a 60-minute walkthrough of BasicXrApp that tours all key components of the OpenXR API in Visual Studio:
下一步操作
现在,你已确定了技术途径,接下来让我们提供你开启创建之旅所需的工具。