overte icon indicating copy to clipboard operation
overte copied to clipboard

Camera correction might not be working correctly in OpenXR

Open ksuprynowicz opened this issue 1 year ago • 4 comments

It looks like camera correction that is normally added after frame batches were generated is not applied correctly on OpenXR. This shows as view jumping around a lot while user looks around in VR. It's less visible in Appimage, and very visible in local builds. It looks like it's much better in mirrors than in regular non-mirrored environment.

ksuprynowicz avatar Apr 13 '25 20:04 ksuprynowicz

For me the appimage version runs pretty much perfectly in OpenXR, while a local build I made is very jerky.

xantoz avatar Apr 14 '25 13:04 xantoz

OpenXrDisplayPlugin::updatePresentPose() is empty on OpenXR, so maybe that's related?

ksuprynowicz avatar Apr 14 '25 20:04 ksuprynowicz

To debug this we should try slowing down or freezing render thread (which generates frame descriptions) and then see if camera position for present thread (which does the actual rendering) updates correctly.

ksuprynowicz avatar Apr 19 '25 18:04 ksuprynowicz

To make the issue more visible, add wait statement to render loop:

void RenderEventHandler::render() {
    if (_checkCall()) {
        _lastTimeRendered.start();
        _renderCall();
        usleep(1000000);
    }
}

On OpenVR it will still be possible to move head around, with updated 3D view. On OpenXR frames will be rendered, but camera position will not be updated.

ksuprynowicz avatar Apr 20 '25 22:04 ksuprynowicz

Thank you to @ada-tv for fixing this!

ksuprynowicz avatar May 05 '25 20:05 ksuprynowicz