-
-
Notifications
You must be signed in to change notification settings - Fork 51
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
Add support for OpenXR #1129
base: master
Are you sure you want to change the base?
Add support for OpenXR #1129
Conversation
The build demands it but it's missing. Copy from upstream vcpkg repo. Fixes the following error: ``` Computing installation plan... error: while looking for jsoncpp:x64-linux: overte-files/vcpkg/cfe0a2a0/ports/jsoncpp: error: jsoncpp does not exist ```
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
super cool! thank you for doing all of this awesome work! I have to take a more complete look, but just a few comments/thoughts on follow up work (not blocking):
|
I wouldn't get too caught up on the play area. This is probably from the times when VR runtimes didn't include this feature already. While it would be nice to have, since it tries to show the play area when teleporting, I don't think we should get caught up on it. I don't think anyone uses teleport movement on here, and the VR runtime most likely already does enough to show the bounds of you play space. |
I do think teleporting is an important feature! but I also spent a bunch of time working on the parabola rendering and intersection logic so maybe I'm biased 😄 maybe we could use the play area for more stuff in the future though. but yeah it was more relevant back when everything used outside-in tracking and it also showed you where the base stations were so you could make sure you were facing them. definitely not a blocker, but seems like it would be cool to have eventually since it seems easy to support. |
Do you have any errors in the log output? Did you set the |
I think I know what happened:
I think that WMR might have set itself as default OpenXR runtime, so I will make sure that SteamVR is the one instead. |
This comment was marked as resolved.
This comment was marked as resolved.
I would move any extension implementations to follow up PRs, also since the extension availability is runtime specific.
Right, this can be probably easily implemented using the
I actually see this as runtime functionality as well, since it's only relevant for PC VR. Obviously overte can also implement system sound and input APIs, e.g. PulseAudio, PipeWire, libinput, X Input depending on the system setup. But I would consider this out of scope for the OpenXR plugin.
I'm actually doing the same as the OpenVR plugin does, but it seems that it was broken there. This would be something worth fixing in connection to the |
This was the case for serveral things in the other plugins which were from a PCVR centric time where the runtimes didn't do as much as they do today. E.g. mirror window, displaying external sensors, selecting the audio device etc. |
Right, this implementation is currently OpenGL only. Hopefully a Vulkan version will be available at some point in the future. |
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
Copy from vcpkg repository. Add OpenXR to hifi-client-deps.
When enabling C++20 the lerp function seems to be redefined on GCC (not on MSVC), don't redefine it using a CMake definition.
Add missing includes on Windows. Include GLX only on Linux. Move openxr_platform.h include to OpenXrContext.h. To make this possible, certain names from GLX/X11 need to be undefined in order to be now includable in OpenXrInput.h. Add Overte e.V. copyright. Co-authored-by: Lubosz Sarnecki <[email protected]>
This comment was marked as resolved.
This comment was marked as resolved.
I got the OpenXR run once, and movement using conrtollers worked, but tablet wouldn't show. Ond second run I got a crash immediately. Here's the backtrace:
|
It works now! I'm not sure what pervious crash was about Batch.h but it doesn't occur on every start. |
To properly implement input for that controller on would need to implement the XR_EXT_samsung_odyssey_controller extension and it's profile and create bindings for that. It might fall back to the
I think I got that one right with the Index controllers, but I need to recheck that. For this controller there might need to be XR_EXT_palm_pose implemented, since it interacts with the extension for that controller. The hand position is currently calculated from |
I just checked again and tablet works. It's just that it shows on other button than on SteamVR, but works perfectly fine. |
|
||
if(CMAKE_CXX_COMPILER_ID MATCHES "GNU") | ||
# Silence GCC warnings | ||
target_compile_options(openxr PRIVATE -Wno-missing-field-initializers) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are we silencing here?
Currently, we hide unsolvable warnings through the OVERTE_WARNINGS_WHITELIST
mechanism. See this PR for examples: https://github.com/overte-org/overte/pull/76/files#diff-3f39502437ebf928710ee1af1c0d2c0d26918dba1e067b6b08cd6b15cf4fb7bb
Closes #181 |
We should test it XRT_PARALLEL_VIEWS=1 Monado environment variable to see if that changes shadows behavior |
I found another problem, mouse cursor in VR doesn't work correctly in this build. It's a very important feature for headsets without controllers. To enable it go to settings and enable reticle. On master branch it works correctly, and on OpenXR branch cursor position is different for each eye, and it's incorrect for both. Clicking on tablet works, but in incorrect position. |
There also seems to be some sort of performance problem - it's extremely stuttery compared to OpenVR with Opencomposite on master branch. |
Another performance problem is that game loop rate doesn't seem to be limited at all, game loop was running at 360 FPS for me, which maybe caused performance issues for other parts of the game? |
The stutter happens even when game runs at constant 90 FPS. I think that it may be caused by camera positions not being updated correctly on the frame before it is rendered - our system generates frame in platform-independent format and then executes it on present thread. Before executing it camera positions are updated. |
It looks like OpenXrDisplayPlugin::updatePresentPose() is empty. Maybe this is the cause? |
I also noticed that head position seems to be too far back compared to master branch. Maybe this also affects controller positions? |
It turns out performance issue was due to local build. I built Appimage in an Ubuntu 24.04 VM and it works pretty nice. It's still not as smooth as it's expected to be at 90 FPS, so it would be worth checking if camera corrections are passed correctly. |
I just tested with WMR hand tracking on Monado, and hand positions are correct in OpenVR, but are incorrectly translated and rotated in OpenXR |
This series of patches provides an initial implementation of
OpenXrDisplayPlugin
andOpenXrInputPlugin
to provide VR support using OpenXR runtimes.In addition, it extends Overte's
eyeOffsets
to account for orientation, which is required for HMDs with screens that are not parallel like the Valve Index. There are also some minor improvements to theOpenGLDisplayPlugin
andApplication
and adds theopenxr-loader
to the vcpkg build.Tested using the Valve Index with Monado and SteamVR on Linux.
Now building on MSVC with C++20!
Potential follow up work
Actions.TranslateX
), but the consistency in their usage needs to be improved.isHmdMounted
, which has no explicit API, could differ between runtimes and might need to be implemented using other system APIs (e.g. on Android)getPlayAreaRect
, which will probably require the use of OpenXR extensions.