Oculus_Developer_Guide

更新时间:2023-06-29 22:04:40 阅读: 评论:0

Version 0.6.0.0
2 | Introduction | Oculus Rift
2 |  | Copyrights and Trademarks
© 2015 Oculus VR, LLC. All Rights Rerved.
OCULUS VR, OCULUS, and RIFT are trademarks of Oculus VR, LLC. (C) Oculus VR, LLC. All rights rerved. BLUETOOTH is a registered trademark of Bluetooth SIG, Inc. All other trademarks are the property of their respective owners. Certain materials included in this publication are reprinted with the permission of the copyright holder.
Oculus Rift | Contents | 3 Contents
LibOVR Integration (4)
Overview of the SDK (4)
Integrating LibOVR (5)
Initialization and Sensor Enumeration (6)
Head Tracking and Sensors (7)
Position Tracking (10)
Ur Input Integration (11)
Health and Safety Warning (12)
Rendering to the Oculus Rift (13)
Rendering to the Oculus Rift (13)细节决定
Rendering Setup Outline (15)
Swap Texture Set Initialization (15)
Frame Rendering (16)
Frame Timing (18)
Rendering on Different Threads (19)
Layers (20)
Advanced Rendering Configuration (26)
Coping with Graphics API or Hardware Rendertarget Granularity (26)
Forcing a Symmetrical Field of View (27)
Improving Performance by Decreasing Pixel Density (29)
Improving Performance by Decreasing Field of View (30)
Improving Performance by Rendering in Mono (31)
Chromatic Aberration (32)
Chromatic Aberration (32)初中运动会口号
Sub-Channel Aberration (32)
SDK Samples and Gamepad Usage (33)
Low-Level Sensor Details (34)
Sensor Fusion Details (34)
Oculus API Changes (35)
Changes Since Relea 0.2 (35)
Changes Since Relea 0.3 (36)
Changes Since Relea 0.4 (37)
Changes Since Relea 0.5 (38)
4 | LibOVR Integration | Oculus Rift
LibOVR Integration
The Oculus SDK is designed to be as easy to integrate as possible. This guide outlines a basic Oculus
integration with a C/C++ game engine or application.
We’ll discuss initializing the LibOVR, HMD device enumeration, head tracking, frame timing, and rendering for the Rift.
Many of the code samples below are taken directly from the OculusRoomTiny demo source code (available in Oculus/LibOVR/Samples/OculusRoomTiny). OculusRoomTiny and OculusWorldDemo are great places to view sample integration code when in doubt about a particular system or feature.
Overview of the SDK
There are three major phas when using the SDK: tup, the game loop, and shutdown.
To add Oculus support to a new application, do the following:
1.Initialize LibOVR through ovr_Initialize.
2.Enumerate Oculus devices, create the ovrHmd object, and start nsor input.
•See: ovrHmd_Create and ovrHmd_ConfigureTracking.
3.Integrate head-tracking into your application’s view and movement code. This involves:
a.Obtaining predicted headt orientation for the frame through a combination of the
ovrHmd_GetFrameTiming and ovrHmd_GetTrackingState calls.
b.Applying Rift orientation and position to the camera view, while combining it with other application
controls.
c.Modifying movement and game play to consider head orientation.
4.Initialize rendering for the HMD.
a.Select rendering parameters such as resolution and field of view bad on HMD capabilities.
•See: ovrHmd_GetFovTextureSize and ovrHmd_GetRenderDesc.
b.Configure rendering by creating D3D/OpenGL-specific swap texture ts to prent data to the headt.
•See: ovrHmd_CreateSwapTextureSetD3D11 and ovrHmd_CreateSwapTextureSetGL.
5.Modify application frame rendering to integrate HMD support and proper frame timing:
a.Make sure your engine supports rendering stereo views.
b.Add frame timing logic into the render loop to obtain correctly predicted eye render pos.
c.Render each eye’s view to intermediate render targets.
d.Submit the rendered frame to the headt by calling ovrHmd_SubmitFram
e.
6.Customize UI screens to work well inside of the headt.
7.Destroy the created resources during shutdown.
•See: ovrHmd_Destroy and ovr_Shutdown.
A more complete summary of rendering details is provided in the Rendering Setup Outline on page 15
ction.
Oculus Rift | LibOVR Integration | 5
Integrating LibOVR
To add Oculus support to a new application, do the following:
1.Initialize LibOVR.
2.Enumerate Oculus devices, create the ovrHmd object, and start nsor input.
3.Integrate head-tracking into your application’s view and movement code. This involves:
a.Obtaining predicted headt orientation for the frame through a combination of the
ovrHmd_GetFrameTiming and ovrHmd_GetTrackingState calls.
b.Applying Rift orientation and position to the camera view, while combining it with other application
controls.
c.Modifying movement and game play to consider head orientation.
4.Initialize rendering for the HMD.
a.Select rendering parameters such as resolution and field of view bad on HMD capabilities.
b.Configure rendering by creating D3D/OpenGL-specific swap texture ts to prent data to the headt.
5.Modify application frame rendering to integrate HMD support and proper frame timing:
a.Make sure your engine supports rendering stereo views.
b.Add frame timing logic into the render loop to ensure that motion prediction and timewarp work
correctly.
c.Render each eye’s view to intermediate render targets.
d.Submit the rendered frame to the headt by calling ovrHmd_SubmitFram
e. This and other details of
frame rendering are covered later in the ction on Frame Rendering.
6.Customize UI screens to work well inside of the headt.
6 | Initialization and Sensor Enumeration | Oculus Rift
纪委全称
Initialization and Sensor Enumeration
This example initializes LibOVR and requests information about the first available HMD.
Review the following code:
// Include the OculusVR SDK
#include <OVR_CAPI_0_6_0.h>
void Application()慢性病申请
{
if (ovr_Initialize(nullptr) == ovrSuccess)
{
ovrHmd    hmd    = nullptr;
ovrResult result = ovrHmd_Create(0, &hmd);
if (result == ovrSuccess)昆明有什么景点
{
// Get more details about the HMD.
ovrSizei resolution = hmd->Resolution;
铁观音属于什么茶...
// Do something with the HMD.
...
ovrHmd_Destroy(hmd);
}
ovr_Shutdown();
}
}
As you can e, ovr_Initialize is called before any other API functions and ovr_Shutdown is called to
shut down the library before you exit the program. In between the function calls, you are free to create HMD objects, access tracking state, and perform application rendering.
In this example, ovrHmd_Create(0, &hmd) creates the first available HMD. ovrHmd_Create access
HMDs by index, which is an integer ranging from 0 to the value returned by ovrHmd_Detect. Urs can call
英雄联盟英雄推荐
ovrHmd_Detect any time after library initialization to re-enumerate the connected Oculus devices. Finally,
ovrHmd_Destroy must be called to clear the HMD before shutting down the library.
If no Rift is plugged in during detection, ovrHmd_Create(0, &hmd) fills in a null handle. In this ca, you
can u ovrHmd_CreateDebug to create a virtual HMD of the specified type. Although the virtual HMD will
not provide any nsor input, it can be uful for debugging Rift-compatible rendering code and for general
development without a physical device.
The ovrHmd handle is actually a pointer to an ovrHmdDesc struct that contains information about the HMD and its capabilities, which is ud to t up rendering. The following table describes the fields:
微信解绑手机号码

本文发布于:2023-06-29 22:04:40,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1060689.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图