This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资源工作流程
版本控制
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Sandworm
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
材质和着色器
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Animations-Related Classes
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
VR-Related Classes
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials

VR 和 XR 开发

虚拟现实(VR)是一种身临其境的环境,让您感觉置身于虚拟或数字复制的真实3D世界中。

UNIGINE offers built-in functionality for development of Virtual Reality and Mixed Reality applications. It enables you to implement logic for various VR devices through a single API interface without using additional plugins.UNIGINE为VR应用程序开发提供内置功能。它使您能够通过单个API接口实现各种VR设备的逻辑,而无需使用额外的插件。

警告
VR plugins (OpenVR, Varjo, Oculus) that implement similar functionality are considered deprecated and will be removed in the next SDK release.实现类似功能的VR插件 (OpenVR, Varjo, Oculus)被认为已弃用,将在下一个SDK版本中删除。

See Also
另请参阅
#

VR System in UNIGINE
UNIGINE中的VR系统
#

The built-in VR system provides integration of OpenVR and Varjo.内置VR系统提供OpenVRVarjo的集成。

OpenVR Integration
OpenVR集成
#

OpenVR is a comprehensive VR SDK (API and runtime) that allows access to VR hardware from various vendors without requiring that applications have specific knowledge of the hardware they are targeting.OpenVR是一个全面的VR SDK (API和运行时),允许访问来自不同供应商的VR硬件,而不需要应用程序具有他们所针对的硬件的特定知识。

So, thanks to OpenVR integration, UNIGINE supports VR development for a wide range of VR devices, including the Oculus Rift, HTC Vive, and other OpenVR-compatible devices. The full list of supported devices is given below.因此,得益于 OpenVR 集成,UNIGINE 支持各种 VR 设备的 VR 开发,包括 Oculus Rift、HTC Vive 和其他 OpenVR 兼容设备。 下面给出了受支持设备的完整列表。

Varjo Integration and Supported Features
Varjo集成
#

图片由 Varjo 提供。

Varjo's industrial-grade headsets with eye-tracking and mixed reality capabilities allow you to create VR and MR applications. With Mixed Reality, you can combine the real-world view from front-facing cameras mounted on the headset with the VR image.具有眼动追踪和混合现实功能的工业级耳机允许您创建VR和XR(eXtended Reality)应用程序。使用混合现实技术,您可以将耳机上的前置摄像头的真实世界视图与VR图像结合起来。

Moreover, there is hand-tracking in VR available for Varjo VR and XR headsets through the Ultraleap integration plugin. It provides finger fidelity, two-hand performance, higher tracking robustness, and a lot of other improvements.此外,通过Ultraleap集成插件,Varjo VR和XR耳机可以使用VR中的手部跟踪功能。它提供了手指保真度、双手性能、更高的跟踪鲁棒性以及许多其他改进。

The following table lists Varjo native features that are supported by UNIGINE VR system:下表列出了UNIGINE VR系统支持的Varjo 原生特性:

Varjo 特性 VR 系统
支持的图形API DX11, DX12, Vulkan
人眼的分辨率 支持
眼动追踪 支持
眼动追踪参数 支持
眼摄像头数据流 不支持
混合现实(MR) 支持
MR环境反射 支持
MR后处理着色器 不支持
MR数据流 支持
色度键控 支持
Varjo 标记 支持
深度缓冲提交 支持
速度缓冲提交 支持
多应用支持 不支持
多层支持 支持
遮挡蒙版 支持
实例化呈现 不支持
注视点渲染 支持
SLI兼容 不支持

Supported Platforms
支持的平台
#

UNIGINE enables development of VR applications for diffent VR platforms.UNIGINE可以为不同的VR平台开发VR应用程序。

Oculus VR
眼睛虚拟现实
#

With UNIGINE VR system, you can implement projects for Oculus HMDs through the integration of OpenVR functionality.使用UNIGINE VR系统,您可以通过集成OpenVR功能来实现Oculus头戴式显示器的项目。

For the correct work, you need to install Oculus Rift PC Runtime.为了正确工作,您需要安装 Oculus Rift PC Runtime

For performance profiling, you can use the Oculus PerfHud tool. It displays performance summary, including frame rate of the application and the unused hardware performance available, latency timing, application render timing, information about the HMD version, and other. To use Oculus PerfHud with UNIGINE, follow the instructions in Oculus documentation.对于性能分析,您可以使用 Oculus PerfHud工具。它显示性能摘要,包括应用程序的帧率和可用的未使用硬件性能、延迟时间、应用程序渲染时间、有关HMD版本的信息等。要将Oculus PerfHud与UNIGINE一起使用,请遵循Oculus文档中的说明。

VR Template provides the models of the Oculus Touch and Oculus Quest controllers that are compatible with Oculus HMDs only.VR Template提供仅与Oculus hmd兼容的Oculus TouchOculus Quest控制器的模型。

SteamVR
SteamVR
#

OpenVR integration allows you to develop projects for the SteamVR platform. It is not tied to a particular hardware: such projects can be used with any VR devices that support SteamVR.OpenVR集成允许您为SteamVR平台开发项目。它不绑定到特定的硬件:这样的项目可以使用任何支持SteamVR的VR设备。

When developing for SteamVR, first you should download and install Steam and then launch SteamVR.在针对 SteamVR 进行开发时,首先您应该下载并安装 Steam,然后启动 SteamVR。

注意
If you install one of the HTC Vive HMDs, the SteamVR will be set automatically on the HMD's installation.如果您安装了一个 HTC Vive HMD , SteamVR将在HMD的安装中自动设置。

For performance profiling, you can use the SteamVR Frame Timing tool.对于性能分析,您可以使用SteamVR Frame Timing工具。

VR Template provides the models of the following SteamVR-compatible controllers: HTC Vive, HTC Vive Pro, and HTC Vive Cosmos.VR Template提供了以下与 SteamVR 兼容的控制器型号:HTC Vive, HTC Vive ProHTC Vive Cosmos

Mixed Reality Development
混合现实开发
#

Thanks to Varjo integration, you can implement Mixed Reality applications to be run with Varjo HMDs.由于有了Varjo集成,您可以实现与 Varjo HMD 一起运行的Mixed Reality应用程序。

To develop an application, you need to install Varjo Base and SteamVR.要开发应用程序,需要安装Varjo BaseSteamVR

Mixed Reality management is performed via the VRMixedReality and VRMarkerObject classes of UNIGINE API.混合现实管理是通过UNIGINE API的VRMixedReality 类执行的。

Supported Devices
支持设备
#

The following VR device models are supported:支持以下VR设备型号:

  • Oculus Rift / Rift S / Quest / Quest 2 (带Oculus Link电缆/ Oculus Link无线)
  • HTC Vive / Vive Pr / Focus / Cosmos
  • Varjo VR-1 / VR-2 / VR-3 / XR-3 (扩展混合现实支持)
  • Windows Mixed Reality (WMR) 兼容
  • OpenVR 兼容

Supported Graphics APIs
支持的图形API
#

The following graphics APIs are supported out of the box:以下图形API是开箱即用的:

  • DirectX 11
  • DirectX 12
  • Vulkan
注意
For OpenGL API support, you will have to use the deprecated VR plugins.对于OpenGL API支持,您将不得不使用已弃用的VR插件。

Initialization
初始化
#

By default, VR is not initialized. To run the engine with VR, you need to specify the -vr_app command-line option on the application start-up.缺省情况下,未初始化VR。要使用VR运行引擎,需要在应用程序启动时指定-vr_app命令行选项。

  • OpenVR命令:
    命令行
    -vr_app openvr
  • Varjo命令:
    命令行
    -vr_app varjo
注意
You cannot launch the VR plugins (OpenVR, Varjo, Oculus) when the built-in VR is initialized, as it overrides the plugin's functionality. If you try to add a VR plugin after VR initialization, you will get an error message.当内置VR被初始化时,您不能启动VR插件(OpenVR, Varjo, Oculus),因为它覆盖了插件的功能。如果您尝试在VR初始化后添加VR插件,您将得到一个错误消息。

VR Input
VR输入
#

UNIGINE VR input system provides access to a wide range of VR devices: you can manage input from VR controllers, head-mounted displays (HMDs), base stations, and trackers.UNIGINE VR输入系统提供对广泛的VR设备的访问:您可以管理来自 VR控制器头戴式显示器(HMD)基站跟踪器的输入。

For more details on types of VR devices and their examples, check the article on VR Input System.有关VR设备类型及其示例的更多详细信息,请查看VR Input System上的文章。

VR Template
VR Template 模板
#

UNIGINE provides a VR Template that is used to facilitate the creation of a custom application for VR. It contains a set of 3D models of popular VR controllers and the implementation of basic mechanics such as grabbing and throwing objects, pressing buttons, opening/closing drawers, and a lot more.UNIGINE提供了一个VR Template 模板,用于方便地为VR创建自定义应用程序。它包含了一组流行的VR控制器的3D模型和基本机制的执行,如抓取和投掷物体,按下按钮,打开/关闭抽屉等等。

The template is created using the Component System, so you can easily extend its functionality.该模板是使用 Component System 创建的,因此您可以轻松地扩展其功能。

Refer to the Getting Started with VR section to learn how to use the template for C++/C# VR project development.参考VR入门文章了解如何使用C++/C# VR项目开发的模板。

Basic Workflow on Using VR
使用VR的基本工作流程
#

Unlike other 3D applications, developing a VR application is more complex: you should set up a VR environment, add interactive elements, process user input from various VR devices, and so on.与其他3D应用程序不同,开发VR应用程序更加复杂:您应该设置VR环境,添加交互元素,处理来自各种VR设备的用户输入,等等。

The general workflow of the VR application development in UNIGINE is the following:在UNIGINE中开发VR应用程序的一般流程如下:

  1. Set up your UNIGINE project for VR development:设置VR开发的UNIGINE项目:

    1. Set up a VR device (check the instructions provided by the vendor, if necessary).设置VR设备(如有必要,请查看供应商提供的说明)。
    2. Configure the project to use the appropriate VR mode. You can perform it via SDK Browser for C++/C# projects or in UnigineEditor for C# projects, depending on your preferred method of running your application.配置项目以使用适当的 VR 模式。 您可以通过 SDK 浏览器(对于 C++/C# 项目)或在 UnigineEditor(对于 C# 项目)中执行此操作,具体取决于运行应用程序的首选方法。
    3. Initialize VR.初始化VR
  2. Create the VR environment:创建VR环境:

    • Create a 3D environment for your VR project by using 3rd-party 3D modeling and level design tools and UnigineEditor.通过使用第三方3D建模和关卡设计工具以及UnigineEditor为您的VR项目创建3D环境。
    • Extend the VR environment with animations, sounds, videos, and other interactive elements.用动画、声音、视频和其他交互元素扩展VR环境。
  3. Make the VR environment more interactive:让VR环境更具互动性:

    • Implement components to extend the functionality of objects in the environment and process user input.实现组件以扩展环境中对象的功能,并处理用户输入
    • Use UNIGINE's VR Template (available for C++ and C# APIs) that offers a basic set of VR components and allows users to move around and interact with objects in the environment.使用 UNIGINE的VR模板(可用于C++和C# API),它提供了一组基本的VR组件,并允许用户在环境中移动和与对象交互。
  4. Debug and profile your VR application. Use the VR platform-specific and UNIGINE built-in profiling tools to improve performance.调试和配置您的VR应用程序。使用VR平台特定的和UNIGINE内置的分析工具来提高性能。
  5. Build and deploy your VR application.构建和部署您的VR应用程序。
最新更新: 2024-02-27
Build: ()