原生开发概述Native development overview

本机横幅徽标

3D 引擎(如 UnityUnreal )并不是唯一的混合现实开发途径。3D engines like Unity or Unreal aren't the only Mixed Reality development paths open to you. 你还可以使用 Windows Mixed Reality Api 和 DirectX 11 或 DirectX 12 来创建混合现实应用。You can also create Mixed Reality apps using the Windows Mixed Reality APIs with DirectX 11 or DirectX 12. 转到平台源实质上是构建自己的中间件或框架。By going to the platform source, you're essentially building your own middleware or framework.

重要

如果你有想要维护的现有 WinRT 项目,请转到我们的主 winrt 文档If you have an existing WinRT project that you'd like to maintain, head over to our main WinRT documentation.

开发检查点Development checkpoints

使用以下检查点,将 Unity 游戏和应用程序带入混合现实的世界。Use the following checkpoints to bring your Unity games and applications into the world of mixed reality.

1.入门1. Getting started

Windows Mixed Reality 支持 两种类型的应用Windows Mixed Reality supports two kinds of apps:

2d 视图和沉浸式视图的 DirectX 开发之间的差异主要涉及全息呈现和空间输入。The differences between DirectX development for 2D views and immersive views primarily concern holographic rendering and spatial input. UWP 应用程序的 IFrameworkView 或 Win32 应用程序的 HWND 是必需的,并且保持基本相同。Your UWP application's IFrameworkView or your Win32 application's HWND are required and remain largely the same. 适用于应用程序的 WinRT Api 也是如此。The same is true for the WinRT APIs that are available to your app. 但您必须使用这些 Api 的不同子集才能利用全息功能。But you must use a different subset of these APIs to take advantage of holographic features. 例如,适用于全息应用程序的系统管理存在和帧,以启用姿势预测帧循环。For example, the system for holographic applications manages the swapchain and frame present to enable a pose-predicted frame loop.

CheckpointCheckpoint 业务成效Outcome
什么是 OpenXR?What is OpenXR? 通过熟悉 OpenXR 以及它所提供的功能,开始进行本机开发旅程Begin your native development journey by getting acquainted with OpenXR and what it has to offer
安装最新工具Install the latest tools 下载并安装最新的本机开发工具Download and install the latest native development tools
为 HoloLens 2 设置Set up for HoloLens 2 为 HoloLens 2 开发配置设备和环境Configure your device and environment for HoloLens 2 development
设置沉浸式耳机Set up for immersive headsets 为 Windows Mixed Reality 开发配置设备和环境Configure your device and environment for Windows Mixed Reality development
尝试示例应用Try a sample app 在设备上浏览相同的基本 OpenXR 应用的 UWP 和 Win32 版本Explore a UWP and Win32 version of the same basic OpenXR app on your device
了解 OpenXR APILearn the OpenXR API 观看60分钟演练视频,在 Visual Studio 中演示 OpenXR API 的所有关键组件Watch a 60-minute walkthrough video that tours all key components of the OpenXR API in Visual Studio
添加 OpenXR 加载程序Add the OpenXR loader 将 OpenXR 加载程序添加到现有本机项目,开始开发Add the OpenXR loader to an existing native project to get started developing

2.核心构建基块2. Core building blocks

Windows Mixed Reality 应用程序使用以下 Api 为 HoloLens 和其他沉浸式耳机构建 混合现实 体验:Windows Mixed Reality applications use the following APIs to build mixed-reality experiences for HoloLens and other immersive headsets:

特性Feature 功能Capability
凝视Gaze 让用户通过查看全息影像来定位它们Let users target holograms with by looking at them
手势Gesture 向你的应用添加空间操作Add spatial actions to your apps
全息渲染Holographic rendering 在世界各地的用户的精确位置绘制一个全息图Draw a hologram at a precise location in the world around your users
运动控制器Motion controller 让用户在混合现实环境中采取措施Let your users take action in your Mixed Reality environments
空间映射Spatial mapping 使用虚拟网格覆盖映射物理空间以标记环境边界Map your physical space with a virtual mesh overlay to mark the boundaries of your environment
语音Voice 捕获用户的口语关键字、短语和听写Capture spoken keywords, phrases, and dictation from your users

备注

可以在 OpenXR 路线图 文档中找到即将推出的和开发中的核心功能。You can find upcoming and in-development core features in the OpenXR roadmap documentation.

3. 部署和测试3. Deploying and testing

可以使用 OpenXR 在 HoloLens 2 或 Windows Mixed Reality 沉浸式耳机上进行开发。You can develop on a desktop using OpenXR on a HoloLens 2 or Windows Mixed Reality immersive headset. 如果你无权访问耳机,则可以改用 HoloLens 2 模拟器Windows Mixed Reality 模拟器If you don't have access to a headset, you can use the HoloLens 2 Emulator or the Windows Mixed Reality Simulator instead.

下一步操作What's next?

开发人员的工作一直在更新,特别是在学习新工具或 SDK 时。A developer's job is never done, especially when learning a new tool or SDK. 以下部分可能会将你带到已完成的初级级别资料之外的区域。The following sections can take you into areas beyond the beginner level material you've already completed. 这些主题和资源不按任何顺序排列,因此可随时跳转并浏览!These topics and resources aren't in any sequential order, so feel free to jump around and explore!

其他资源Additional resources

如果想要对 OpenXR 游戏进行调配,请查看以下链接:If you're looking to level up your OpenXR game, check out the links below:

另请参阅See also