Unreal 开发概述Unreal Development Overview

Unreal 横幅徽标

开始使用混合现实应用程序是一个重大任务。Getting started with mixed reality applications is a big task. 新概念、平台和前沿硬件看似都障碍重重。New concepts, platforms, and cutting edge hardware can seem like barriers. 但是,如果你是 Unreal 的开发人员,那么你很幸运。However, if you're an Unreal developer you're in luck. Windows Mixed Reality (VR) 和 HoloLens 2 (AR) 的支持现已包含在 Unreal Engine 的最新 版本中。Support for Windows Mixed Reality (VR) and HoloLens 2 (AR) is now included in Unreal Engine's newest release. 此更新包括:This update includes:

  • 混合现实 UX Tools 插件支持Mixed Reality UX Tools plugin support
  • OpenXR 支持OpenXR support
  • 桌面应用中的应用远程处理App Remoting from a desktop app
  • 更好的性能Better performance
  • 混合现实捕获Mixed reality capture
  • 对 Azure 空间定位点的初始支持Initial support for Azure Spatial Anchors

如果你不熟悉 Unreal 开发,请勿直接跳转。If you're new to Unreal development don't jump in blind. 探索 Unreal 教程系列,以快速了解和查找 Unreal 市场和混合现实论坛中的资产和支持。Explore the Unreal tutorial series to get up to speed and look for assets and support in the Unreal marketplace and mixed reality forums. 这些资源是指向当今混合现实市场中的构建者和问题解决者的社区的链接。These resources are your links to the community of builders and problem solvers in todays mixed reality market.

开发检查点Development checkpoints

使用以下检查点,将 Unreal 游戏和应用程序带入混合现实的世界。Use the following checkpoints to bring your Unreal games and applications into the world of mixed reality. 如果你尚未浏览设计全息影像示例应用程序,我们建议下载并使用它来熟悉混合现实 UX 的基本知识。If you haven't already explored the Designing Holograms sample application, we recommend downloading and using it to familiarize yourself with the basics of Mixed Reality UX.

1.入门1. Getting started

适用于 Unreal 的混合现实工具包是一组设计用于在 Unreal 中加快开发速度的组件。The Mixed Reality Toolkit for Unreal is a set of components designed to speed up your development in Unreal. 每个组件都包含用于设置沉浸式体验的插件、示例和文档。Each component includes plugins, samples, and documentation for setting up immersive experiences.

  • 适用于 Unreal 的 UX Tools 是第一个要发布的组件,目前仅在 HoloLens 2 上受支持。UX Tools for Unreal is the first component to be released and is currently only supported on HoloLens 2. 组件插件包括代码、蓝图以及用于输入模拟的常见 UX 功能的示例资产、手势交互 Actor、可按按钮组件、操纵器组件和跟踪行为组件。The component plugin includes code, blueprints, and example assets of common UX features for input simulation, hand interaction actors, press-able button components, manipulator components and follow behavior components.

本部分结束时,你将对混合现实工具包有一个基本的了解、对混合现实应用有一个正确配置的开发环境以及一个可在 Unreal 中正常工作的 MRTK 项目。By the end of this section, you'll have a basic understanding of the Mixed Reality Toolkit, a properly configured development environment for Mixed Reality apps, and a working MRTK project in Unreal.

CheckpointCheckpoint 业务成效Outcome
安装最新工具Install the latest tools 下载并安装最新 Unity 包,并为混合现实设置你的项目Download and install the latest Unity package and setup your project for mixed reality
HoloLens 2 教程系列HoloLens 2 tutorial series 深入研究 HoloLens 2 硬件的初学者级别 MRTK 教程Dive into beginner level MRTK tutorials for HoloLens 2 hardware

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

有几项混合现实开发的重要功能在教程系列中未涉及。There are several key features of mixed reality development that our tutorial series doesn't cover. 这些构建基块可以作为独立功能提供,也可以通过混合现实工具包提供。These building blocks are available as standalone features and through the Mixed Reality Toolkit. 你可能不需要一次全部使用它们,但建议你尽早进行使用。You might not need all of them at once, but we recommend exploring early on. 深入了解下面列出的核心构建基块后,你将拥有一个工具箱,其中包含了各种你可以集成到混合现实项目中的功能。After diving into the core building blocks listed below, you'll have a toolbox full of features you can integrate into your Mixed Reality projects.

Feature Capabilities
Input simulation Use mouse and keyboard input in the editor to simulate a Head-Mounted Display (HMD) and hand tracking features
Hand interaction Interact with UX components using articulated hand inputs
Pressable button component Drive the state of button blueprints through low level components
Manipulator component Move and rotate an actor with one or two-hand manipulation input
Follow behavior component Keep an actor or component within sight of another component

备注

有关更多详细信息,可以深入了解适用于 Unreal 的 UX Tools GitHub 存储库。You can dive into the UX Tools for Unreal GitHub repository for more details.

3.平台功能和 API3. Platform capabilities and APIs

在混合现实应用程序中起作用的其他关键功能可用,无需任何额外的包或设置。Other key features that play a role in mixed reality applications are available without any extra packages or setup. 可以在安装或未安装 MRTK 的情况下将这些功能添加到 Unreal 项目中。These features can be added to Unreal projects with or without MRTK installed. 深入了解这些更高级功能后,你将可以生成更复杂的混合现实应用。After diving into these more advanced capabilities, you'll be able to build more complex Mixed Reality apps.

功能Feature 功能Capabilities
HoloLens 摄像头HoloLens camera 从在 HoloLens 设备上运行的应用捕获混合现实视觉内容和真实世界视觉内容Capture Mixed Reality and real-world visual content from your app running on a HoloLens device
QR 码QR codes 使用坐标系统在每个 QR 码的真实世界位置将 QR 码呈现为全息影像Render QR codes as holograms using a coordinate system at each code's real-world position
WinRTWinRT 使用可由 Unreal 的生成系统使用的 WinRT 代码创建一个单独的二进制文件Create a separate binary with WinRT code that can be consumed by Unreal’s build system

4.部署到设备4. Deploying to a device

如果这是你第一次为 HoloLens 创建或部署 Unreal 应用,则需要从 Epic Launcher 下载支持文件If this is your first time creating or deploying an Unreal app for HoloLens, you'll need to download supporting files from the Epic Launcher. 安装这些文件后,即可从 Unreal 编辑器设备门户进行部署。Once you have those files installed, you're ready to deploy from either the Unreal editor or the Device Portal.

5.添加服务5. Adding services

在开发历程中的这个阶段,你可能希望添加服务或寻求商业部署方面的帮助。At this point in your development journey you might be looking to add services or for a helping hand with commercial deployment. Azure 云服务 与 Dynamics 365 功能集成可以在很大程度上提高项目的水平。Integrating Azure Cloud Services and Dynamics 365 features can level up your projects in a major way. 我们已编译了几个入门点,用于探索和扩展你的混合现实知识。We've compiled a few starting points for you to explore and expand your Mixed Reality knowledge.

Azure Spatial Anchors (ASA) is a cross-platform service that allows you to build spatially aware mixed reality applications. With Azure Spatial Anchors, you can map, persist, and share holographic content across multiple devices, at real-world scale.

下一步操作What's next?

开发人员的工作一直在更新,特别是在学习新工具或 SDK 时。A developers 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, along with helpful resources if you get stuck. 请注意,这些主题和资源不按任何顺序排列,因此请随意查看并探索!Note that these topics and resources are not in any sequential order, so feel free to jump around and explore!

流式处理及调试Streaming & Debugging

如果你想要在 HoloLens 设备上测试仍处于开发阶段的应用程序,则可以使用 Unreal 编辑器或打包的 Windows 可执行文件从电脑直接流式传输该应用程序If you want to test out your application on a HoloLens device while still in development, you can stream it directly from your PC by using either the Unreal editor or a packaged Windows executable file.

如果希望使用 Visual Studio 调试应用程序,请遵循以下说明If you're looking to debug the application with Visual Studio, follow these instructions.

性能Performance

混合现实开发附带依赖于平台的性能检查点。Developing for mixed reality comes with performance checkpoints that depend on the platform. HoloLens 2 应用必须以每秒 60 帧的速度运行,才能使全息影像稳定显示且快速响应。A HoloLens 2 app must run at 60 frames per second for holograms to appear stable and responsive. 幸运的是,我们提供了有关在 Unreal 应用程序中实现这种效果的性能建议Luckily, we have performance recommendations for achieving this in your Unreal applications.

支持的功能Supported Features

HoloLens 2 功能HoloLens 2 Feature 最早支持的 Unreal Engine 版本Earliest Supported Unreal Engine Version
ARM64 支持ARM64 support 4.234.23
从电脑进行流式传输Streaming from a PC 4.234.23
空间映射Spatial mapping 4.234.23
手动和联合跟踪Hand and joint tracking 4.234.23
眼动跟踪Eye tracking 4.234.23
语音输入Voice input 4.234.23
空间定位点Spatial anchors 4.234.23
摄像头访问Camera access 4.234.23
QR 码QR codes 4.234.23
空间音频Spatial audio 4.234.23
Spectator Screen 支持流式传输Spectator Screen support for streaming 4.244.24
通过流式传输的平面 LSRPlanar LSR over streaming 4.244.24
示例应用(HoloLens2Example任务 ARSample apps (HoloLens2Example and Mission AR) 4.244.24
移动多视图:性能达到 60 fpsMobile multi-View: Performance hits 60 fps 4.254.25
第三人称摄像机渲染3rd camera render 4.254.25
从打包的桌面应用进行流式传输Streaming from a packaged desktop app 4.25.14.25.1
面向 HoloLens 2 的 Azure 空间定位点 (beta)Azure Spatial Anchors for HoloLens 2 (beta) 4.254.25
OpenXR 支持 (beta)OpenXR support (beta) 4.254.25
UX Tools 支持 (0.8)UX Tools support (0.8) 4.254.25
开发人员文档和教程Developer docs & tutorials 4.254.25

另请参阅See also