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
统一的Unigine着色器语言 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
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

带有Oculus插件的Oculus Rift输出

警告
该插件已弃用。自2.18以来,除了OpenGL之外,所有支持的图形api都可以使用VR功能

The Oculus plugin is used to support the Oculus Rift head-mounted display. For the correct work of the plugin Oculus Rift PC Runtime is required. Note that your customers must have runtime installed as well. The plugin supports all HMD types supported by the latest Oculus Rift PC Runtime (including Oculus Rift CV1 (Consumer Version). Oculus 插件用于支持Oculus Rift头戴式显示器。为了正确运行插件,必须使用 Oculus Rift PC Runtime 。请注意,您的客户还必须安装运行时。该插件支持最新的Oculus Rift PC运行时(包括Oculus Rift CV1(消费版))支持的所有HMD类型。

注意
Since Oculus VR has stopped supporting Linux, the plugin is available only for Windows.由于Oculus VR已停止支持Linux,因此该插件仅适用于Windows。
注意
该插件只支持DirectX 11OpenGL API。对于其他图形API,请使用内置的VR功能

The Oculus plugin provides the VR mode that allows for rendering to both the Oculus Rift head-mounted display and the PC display. When the VR mode is disabled, the image is rendered only to the PC display. The mode can be toggled by using the engine.oculus.setEnabled() function. Oculus插件提供了 VR模式,该模式允许渲染到Oculus Rift头戴式显示器和PC显示器。禁用VR模式时,图像仅渲染到PC显示器。可以使用 engine.oculus.setEnabled() 函数来切换模式。

Both the windowed and the full screen modes are supported. On the PC display the image is rendered as follows: 窗口模式和全屏模式均受支持。在PC显示屏上,图像呈现如下:

Valley benchmark rendered on PC display with Oculus使用Oculus在PC显示器上呈现的Valley基准

See Also
也可以看看#

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

Implementing Unigine Application with Oculus Support
在Oculus支持下实现Unigine应用程序#

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

  1. Get and set up the latest Oculus Rift PC Runtime.获取并设置最新的 Oculus Rift PC运行时
  2. Create a new project with Oculus support via UNIGINE SDK Browser: click Video Output Options, check the Oculus support (Oculus plugin) option in the form that opens and click OK.
    注意
    To add Oculus support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok. To add Oculus support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok.

    To add Oculus support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok.
    通过UNIGINE SDK浏览器创建一个具有Oculus支持的新项目:单击视频输出选项,选中表单中的 Oculus支持(Oculus插件) 选项随即打开,然后点击确定
    注意
    To add Oculus support to an existing project, in UNIGINE SDK Browser, click Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok. 要将Oculus支持添加到现有项目中,请在UNIGINE SDK浏览器中,单击Other Actions -> Configure Project -> Video Output Options -> Oculus support (Oculus plugin) -> Ok.

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

Launching Oculus
启动Oculus#

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

命令行
main_x64.exe -extern_plugin "UnigineOculus"

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

注意
Head-tracking support is available by default.头部跟踪支持默认情况下可用。

Oculus Options
Oculus选项#

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

  • oculus_density - the render target pixel density. In other words, this is the ratio of the number of render target pixels to display pixels at the center of distortion. The default value is 1.0 (the render target pixel density matches the display surface at the point on the display). oculus_density -渲染目标像素密度。换句话说,这是渲染目标像素数与失真中心处的显示像素的数量之比。 默认值为1.0(渲染目标像素密度与显示器表面上的显示点相匹配)。
  • oculus_scale - the world scale. The default value is 1.0. oculus_scale -世界范围。默认值为1.0
命令行
main_x64d -extern_plugin "UnigineOculus" -oculus_density 1.0 -oculus_scale 8.0

Console Commands
控制台命令#

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

名称 描述 争论
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 (images sent to VR device)
3 — stereo final (images with additional VR device distortions, etc.)
0 --黑屏
1 --单反(默认)
2 --立体(图像发送到VR设备)
3 --最终立体(附加VR设备扭曲的图像等)
最新更新: 2024-06-07
Build: ()