Intro to Oculus CPSC 585 Oculus General Workings

  • Slides: 19
Download presentation
Intro to Oculus CPSC 585

Intro to Oculus CPSC 585

Oculus

Oculus

General Workings Frames to render Position / Orientation of cameras (eyes)

General Workings Frames to render Position / Orientation of cameras (eyes)

Distortion • Scene to be rendered in split-screen stereo with half of the screen

Distortion • Scene to be rendered in split-screen stereo with half of the screen used for each eye • Asynchronous Time. Warp: used to smooth out literally unplayable games

Rendering to Oculus • Scene to be rendered in split-screen stereo with half of

Rendering to Oculus • Scene to be rendered in split-screen stereo with half of the screen used for each eye

Rendering to Oculus • Each eye is represented by a camera • Both of

Rendering to Oculus • Each eye is represented by a camera • Both of which are separated but parallel in direction IPD

Eye Positions / Orientations • Oculus contains a bunch of sensors for tracking orientation

Eye Positions / Orientations • Oculus contains a bunch of sensors for tracking orientation • Another sensor is used for translation

Initialize SDK • ovr_Initialize(sdk. Params) – sdk. Params as nullptr uses default values –

Initialize SDK • ovr_Initialize(sdk. Params) – sdk. Params as nullptr uses default values – Log. Callback

Initialize HMD • ovr_Create(&session, &luid) • luid – Handle to graphics card that has

Initialize HMD • ovr_Create(&session, &luid) • luid – Handle to graphics card that has the HMD attached • hmd. Desc = ovr_Get. Hmd. Desc(session) – Resolution – Refresh Rate – Default. Eye. Fov – Etc….

Initialize buffers for each eye • ovr. Sizei ovr_Get. Fov. Texture. Size(…) – Calculates

Initialize buffers for each eye • ovr. Sizei ovr_Get. Fov. Texture. Size(…) – Calculates the recommended viewport size for eye given fov • ovr_Create. Texture. Swap. Chain. GL(…) – Series of buffers which hold frames to be displayed

Initialize buffers for each eye • For each buffer in swap chain – Bind

Initialize buffers for each eye • For each buffer in swap chain – Bind and set wrap and filter behaviour • Create a framebuffer and a depth buffer to render to • ovr_Get. Render. Desc(…) – rendering parameters for the specified eye – Hmd. To. Eye. Offset (translation of given eye in meters)

Main Loop • Get abs time at which the current frame should be displayed

Main Loop • Get abs time at which the current frame should be displayed • ovr_Get. Predicted. Display. Time(…) • Get predicted pose based on abs time, distance of eye from headset, etc… • tracking. State = ovr_Get. Tracking. State(…) • ovr_Get. Eye. Poses(…)

Pose and Position

Pose and Position

Render to an Eye • ovr_Get. Texture. Swap. Chain. Buffer. GL(…) – Get current

Render to an Eye • ovr_Get. Texture. Swap. Chain. Buffer. GL(…) – Get current buffer from swap chain • • Bind and clear that eye’s frame buffer Calculate eye Proj * View matrix transform Render Scene Repeat for other eye

Updating Oculus • ovr. Layer. Eye. Fov – Combines both swap chains with FOV

Updating Oculus • ovr. Layer. Eye. Fov – Combines both swap chains with FOV and IPD – Can use many layers for Game, GUI, etc… • ovr_Submit. Frame(…) – Submits layer for rendering

Shutdown • delete depth textures and framebuffers for each eye • ovr_Destroy. Texture. Swap.

Shutdown • delete depth textures and framebuffers for each eye • ovr_Destroy. Texture. Swap. Chain(…) for each eye • ovr_Destroy(…) destroy session • ovr_Shutdown() shutdown sdk

Best Practices • Don’t affix an image in front of the user, such as

Best Practices • Don’t affix an image in front of the user, such as a full-field splash screen • Images presented to each eye should differ only in terms of viewpoint • Consider supersampling and/or anti-aliasing

Best Practices • Code should run at a frame rate equal to or greater

Best Practices • Code should run at a frame rate equal to or greater than the Rift display refresh rate • Repeated exposure to the Rift makes you less susceptible to sickness • Do not use “head bobbing” camera effects • Avoid using Euler angles

Resources • Oculus SDK is well documented – OVR_CAPI. h, OVR_CAPI_GL. h • http:

Resources • Oculus SDK is well documented – OVR_CAPI. h, OVR_CAPI_GL. h • http: //pages. cpsc. ucalgary. ca/~laringha/585 W 17. html