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
双精度坐标
应用程序接口
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
创建内容
内容优化
材质
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

带有OpenVR插件的HTC Vive输出

The OpenVR plugin is used to support both the HTC Vive and the HTC Vive Pro head-mounted displays. It is supposed that you already have HTC Vive/Vive Pro HMD installed. SteamVR will be set automatically on the HTC Vive (HTC Vive Pro HMD) installation.OpenVR插件用于支持HTC ViveHTC Vive Pro头戴式显示器。假定您已经安装了HTC Vive/Vive Pro HMD。 SteamVR将在HTC Vive (HTC Vive Pro HMD)安装中自动设置。

Both the windowed and the full screen modes are supported. By default, on the PC display the image is rendered in mono mode (image from the left eye). Use setViewportMode() to change the mode to stereo (both eyes) as follows:窗口模式和全屏模式均受支持。默认情况下,在PC显示器上以单模式渲染图像(左眼图像)。使用setViewportMode()将模式更改为立体声(双眼),如下所示:

All UNIGINE projects supporting SteamVR are compatible with both HTC Vive and HTC Vive Pro. However, please note that Vive Pro has a higher display resolution, and although no modifications are required, it is recommended to check your project's performance and optimize it accordingly.所有支持SteamVR的UNIGINE项目均与HTC Vive和HTC Vive Pro兼容。但是,请注意,Viv​​e Pro具有更高的显示分辨率,尽管不需要进行任何修改,但建议您检查项目的性能并相应地对其进行优化。

也可以看看

  • OpenVR API职能
  • <UnigineSDK>/data/samples/plugins/app_vive_00 sample

To run the plugin sample from the UNIGINE SDK Browser, go to the Samples tab, choose UnigineScript -> App and run the app_vive_00 sample.要从UNIGINE SDK浏览器运行插件示例,请转到Samples选项卡,选择UnigineScript -> App并运行 app_vive_00 示例。

Implementing Unigine Application with OpenVR Support在OpenVR支持下实施Unigine应用程序#

To use the HTC Vive virtual display with Unigine, perform the following:要将HTC Vive虚拟显示器与Unigine一起使用,请执行以下操作:

  1. Download Vive Setup and perform all required steps.下载 Vive设置,然后执行所有必需的步骤。
  2. Create a new project with OpenVR support via UNIGINE SDK Browser: click Plugins, check the OpenVR support (OpenVR plugin) option in the form that opens and click OK. 通过UNIGINE SDK浏览器创建具有Vive支持的新项目:单击Plugins,在打开的表单中检查OpenVR support (OpenVR plugin)选项,然后单击OK

    注意
    To add OpenVR support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Plugins -> OpenVR support (OpenVR plugin) -> Ok. 要将Vive支持添加到现有项目,请在UNIGINE SDK浏览器中,单击Other Actions -> Configure Project -> Plugins -> OpenVR support (OpenVR plugin) -> Ok.

  3. Implement the application logic by using functions of the OpenVR plugin API.通过使用OpenVR插件API的功能来实现应用程序逻辑。
  4. Plug in the HTC Vive virtual display.插入HTC Vive虚拟显示器。
  5. Launch the OpenVR plugin on the application start-up.在应用程序启动时启动 OpenVR插件。

Launching OpenVR启动OpenVR#

To launch the plugin, specify the extern_plugin command line option on the application start-up:要启动插件,请在应用程序启动时指定 extern_plugin 命令行选项:

命令行
main_x64.exe -extern_plugin "OpenVR"

If you run the application via UNIGINE SDK Browser, set the Stereo 3D option to HTC Vive in the Options tab and click Apply: 如果通过UNIGINE SDK浏览器运行该应用程序,请在Options选项卡中将HTC Vive in the Options tab and click Apply

OpenVR OptionsOpenVR选项#

The following CLI options can be specified on the application start-up:可以在应用程序启动时指定以下CLI选项:

  • openvr_render_width and openvr_render_height - set a resolution for each eye. The default resolution for one eye is set equal to recommended value by SteamVR.

    Please note that by default SteamVR selects resolution based on your computer's performance. Therefore, for best image quality it is recommended to open the Video tab of the SteamVR settings window, enable Manual Override mode and set resolution to 100%. Please note that by default SteamVR selects resolution based on your computer's performance. Therefore, for best image quality it is recommended to open the Video tab of the SteamVR settings window, enable Manual Override mode and set resolution to 100%.

    So the resolution will be set as follows: So the resolution will be set as follows:

    HTC Vive HTC Vive Pro
    Resolution per eye 1512 x 1680 2016 x 2240
    注意
    The same resolution is set for both eyes.The same resolution is set for both eyes.
    Please note that by default SteamVR selects resolution based on your computer's performance. Therefore, for best image quality it is recommended to open the Video tab of the SteamVR settings window, enable Manual Override mode and set resolution to 100%. So the resolution will be set as follows:The same resolution is set for both eyes.
    openvr_render_width openvr_render_height -为每只眼睛设置分辨率。一只眼睛的默认分辨率设置为等于SteamVR的建议值。

    Please note that by default SteamVR selects resolution based on your computer's performance. Therefore, for best image quality it is recommended to open the Video tab of the SteamVR settings window, enable Manual Override mode and set resolution to 100%. 请注意,默认情况下,SteamVR根据计算机的性能选择分辨率。因此,为了获得最佳图像质量,建议打开SteamVR设置窗口的“视频”标签,启用手动覆盖模式并将分辨率设置为100%。

    So the resolution will be set as follows:因此,分辨率将设置如下:

    HTC Vive HTC Vive Pro
    Resolution per eye 1512 x 1680 2016 x 2240
    注意
    The same resolution is set for both eyes.两只眼睛设置相同的分辨率。
命令行
main_x64d -extern_plugin "OpenVR" -openvr_render_width 1512 -openvr_render_height 1680

Console Commands控制台命令#

The following console commands can be run for the OpenVR plugin.可以为OpenVR插件运行以下控制台命令。

名称 描述 争论
vr_viewport_mode
  • Command. Sets the viewport mode.命令。 设置视口模式。
  • Variable. Prints the value specifying which viewport mode is set.变量。 打印指定所设置的视口模式的值。
0 — black screen
1 — mono (default)
2 — stereo
0 --黑屏
1 --单反(默认)
2 --立体
最新更新: 2023-08-08
Build: ()