VR

最近因为项目需求,需要对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:

  1. Initialize LibOVR through ovr_Initialize.
  2. 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).
  3. 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

  4. 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.
  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 poses.
    c. Render each eye’s view to intermediate render targets.
    d. Submit the rendered frame to the headset by calling ovr_SubmitFrame.

  6. Customize UI screens to work well inside of the headset.

  7. 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都可以查阅到,就不累赘了。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值