带有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 Vive和HTC 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兼容。但是,请注意,Vive 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一起使用,请执行以下操作:
- Download Vive Setup and perform all required steps.下载 Vive设置,然后执行所有必需的步骤。
-
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. - Implement the application logic by using functions of the OpenVR plugin API.通过使用OpenVR插件API的功能来实现应用程序逻辑。
- Plug in the HTC Vive virtual display.插入HTC Vive虚拟显示器。
- 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 "UnigineOpenVR"
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 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的建议值。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%. 请注意,默认情况下,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 "UnigineOpenVR" -openvr_render_width 1512 -openvr_render_height 1680
Console Commands控制台命令#
The following console commands can be run for the OpenVR plugin.可以为OpenVR插件运行以下控制台命令。