bgfx icon indicating copy to clipboard operation
bgfx copied to clipboard

OpenVR support

Open coldev opened this issue 7 years ago • 7 comments

Thanks for this powerfull renderer layer ..

Is possible support OpenVR api ? ( Include all VR' S in One )

coldev avatar May 26 '17 00:05 coldev

It is possible, just it's not supported right now.

bkaradzic avatar May 26 '17 02:05 bkaradzic

I'd like to look at this and have started this in relation to LumixEngine...

Some work already started: OpenVR by @mendsley

3 things:

  • It uses the compositor which might tread on how much your app wants to do that part or just give control to OpenVR.
  • This is DX11 only for now, might need to make a better way of detecting and using other APIs
  • Using the C++ bindings when the C-API should be used so we can dynamically load in the lib and not link to it at compile time (some scary info on the net where the C-API is a bit lousy though so I'll hold off from now until I get the actual thing working)

Also it doesn't compile out of the box when you rebase it on the latest BGFX so probably the base HMD struct/header has changed, need to investigate that.

My branch will be here

Cheers

boberfly avatar Jun 14 '17 15:06 boberfly

Can you update that branch to latest? Not being able to dynamically loads means it has to be build configuration --with-openvr. Overall sounds reasonable. No need to complete anything it could be just considered WIP.

bkaradzic avatar Jun 14 '17 16:06 bkaradzic

Yep updated the branch to latest @bkaradzic

boberfly avatar Jun 17 '17 05:06 boberfly

Hey @bkaradzic

Just after some advice, I've got this in getInternalData: https://github.com/boberfly/bgfx/blob/openvr/include/bgfx/platform.h#L75

But I'm thinking this might not be a good idea calling this after bgfx::init on the main/game thread when the renderer thread owns it. I still need to work out if I can call getWaitPoses from OpenVR from separate threads and twice a frame (one in the game code to get transforms) and then in bgfx right before the render submission...

boberfly avatar Jun 20 '17 07:06 boberfly

Hello —

I may be interested in collaborating to improve OpenVR support. I'm thinking about migrating my project SoundSelf from OpenGL 3.1 to BGFX.

Re: @boberfly, I realize this is a late reply but OpenVR provides a separate transform for use in the next game frame. You could ringbuffer it over to the game engine.

EvanBalster avatar Apr 26 '18 17:04 EvanBalster

Hi there, has there been any more recent progress on this (or OpenXR support)?

totalgee avatar Nov 18 '21 15:11 totalgee