Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for OpenXR #602

Closed
lachlansneff opened this issue Apr 19, 2020 · 6 comments
Closed

Support for OpenXR #602

lachlansneff opened this issue Apr 19, 2020 · 6 comments
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request

Comments

@lachlansneff
Copy link
Contributor

I opened an issue on gfx-rs for adding OpenXR support (gfx-rs/gfx#3219).

OpenXR is pretty new, but there are basic bindings for it in rust already https://docs.rs/openxr. Eventually, supporting this would enable applications that use gfx-hal directly or libraries that use gfx-hal, like wgpu, to transparently support most vr and ar headsets on most architectures.

I'm proposing that support gets added to gfx-hal. I can contribute to this, but I don't know where to start.

OpenXR also adds support for grabbing events from peripherals specific to XR environments. That might have to be supported in winit maybe?

@kvark kvark added area: api Issues related to API surface type: enhancement New feature or request help required We need community help to make this happen. labels Apr 20, 2020
@memoryruins
Copy link
Contributor

Looks like there was some progress towards this in #1609, #1850, and #2186.

#1609 links sample usage (potentially outdated) and #2186 mentions:

With the recent move to wgpu-hal, and now being able to access the raw backing types, it has become possible to use OpenXR with the current released version of WGPU. (It works pretty well too!)

If anyone using the above would like to share example usage here, some would definitely appreciate it. I've seen a few questions about wgpu OpenXR support in various chats, which led me to these ^^

@TheButlah
Copy link

TheButlah commented Mar 11, 2022

I am also extremely interested in this! I currently have no clue how to use the openxr bindings with wgpu - the only two graphics trait implementations there are for opengl and vulkan. I assume having the graphics trait implemented for webgpu would be necessary for support?

https://docs.rs/openxr/latest/openxr/trait.Graphics.html

@thejudge156
Copy link

Any updates on this?

@schell
Copy link
Contributor

schell commented Sep 27, 2022

I have a sneaking suspicion that one could accomplish joining wgpu and openxr by using wgpu (backed by vulkan) to render to textures which are then composited by openxr, but that conclusion is not well-researched on my part. Is there a specific reason wgpu would need openxr things in its code?

@philpax
Copy link

philpax commented Oct 23, 2022

Hi all! Over the last few weekends, I've implemented a barebones example of wiring up OpenXR to wgpu (Vulkan). Here's the link.

It should have everything you need to get going, including working without a headset, getting controller positions, and rendering to both the headset and the window simultaneously. It's designed to easily exclude the XR code, so you can see what needs to be added to bring up XR in an existing wgpu codebase.

There's still a few quirks and bugs that I haven't ironed out, but given it's served its purpose for me (a worked example of implementing XR in a wgpu application), I figure now is as good a time as any to release it!

Hope it helps 🥳

@cwfitzgerald
Copy link
Member

Closing as this now seems possible. While we probably can't accept an example for this in-repo, out of repo examples would be great to link to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: api Issues related to API surface help required We need community help to make this happen. type: enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

8 participants