-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Fixed XR Layer rendering race condition with session initialization and RenderState Update #5489
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
Conversation
…nd RenderState update.
|
Good catch, wondering if it might be better to ensure that we only set Should be a matter of rearranging the code in |
|
Yeah that makes perfect sense to me. I will update the commit to reflect this and do some tests. Thanks for the suggestion. |
|
I did some tests and I found out that we are generally not handling the undefined |
Thanks. Is the change we suggested in #5489 (comment) not enough? Feel free to suggest alternatives. We should definitively handle |
|
The |
|
Thanks @mrxz ! Moving the position of |
|
@zjm-meta thanks so much for the effort. great work. congrats on your first contribution! 👏 |
…zation and RenderState Update (aframevr#5489)" This reverts commit 77af389.
Description:
The aframe comicbook example was broken with exceptions of
and
The issues are related to the race condition. The
!this.el.sceneEl.xrSessioncheck in this line doesn't guarantee the full initialization of the xr session. We should actually use thethis.el.sceneEl.renderer.xr.isPresentingvalue which is set totrueat the end of XR session initialization here.Another race condition is that the
this.xrGLFactory.getSubImagecall should happen AFTER the layer is added to the sessions layers array (related W3C doc). This happens in the next frame aftersceneEl.renderer.xr.addLayeris called. Thus, we shouldn't force a redraw inonEnterVR. Instead, we need to rely on thethis.layer.needsRedrawvalue here to trigger a redraw after the layer is added to the session layers array.Changes proposed:
tick()function ifthis.el.sceneEl.renderer.xr.isPresenting === falseonEnterVR.Testing
Ran
npm startand used port forwarding to test in a Quest 3 headset. The comic book example works smoothly.