您的位置:首页 > 其它

VR

2016-04-20 14:15 225 查看
最近因为项目需求,需要对VR的SDK这一块进行研究。目标:通过API调用使得Deltagen里的模型和头部追踪的行为Pose同步。

准备先从Oculus入手。研究流程初步计划:

1. Setup environment
2. Get headset trace value
3. Update camera's value in Deltagen scene.


Oculus的Develop文档的官方链接:https://developer.oculus.com/documentation/pcsdk/latest/concepts/dg-libovr/

Overview of the SDK

There are three major phases when using the SDK: setup, the game loop, and shutdown.

To add Oculus support to a new application, do the following:

Initialize LibOVR through ovr_Initialize.

Call ovr_Create and check the return value to see if it succeeded. You can periodically poll for the presence of an HMD with ovr_GetHmdDesc(nullptr).

Integrate head-tracking into your application’s view and movement code. This involves:

a. Obtaining predicted headset orientation for the frame through a combination of the GetPredictedDisplayTime and ovr_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.c

Initialize rendering for the HMD.

a. Select rendering parameters such as resolution and field of view based on HMD capabilities.

See: ovr_GetFovTextureSize andovr_GetRenderDesc.

b. Configure rendering by creating D3D/OpenGL-specific swap texture sets to present data to the headset.

See: ovr_CreateTextureSwapChainDX andovr_CreateTextureSwapChainGL.

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 poses.

c. Render each eye’s view to intermediate render targets.

d. Submit the rendered frame to the headset by calling ovr_SubmitFrame.

Customize UI screens to work well inside of the headset.

Destroy the created resources during shutdown.

See: ovr_DestroyTextureSwapChain, ovr_Destroy, and ovr_Shutdown.

A more complete summary of rendering details is provided in the Rending Set Outline section.

以上为摘录的Oculus document文档,其基本用法在document都可以查阅到,就不累赘了。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  VR Oculus