immersive-web / webxr-samples

Samples to demonstrate use of the WebXR Device API
https://immersive-web.github.io/webxr-samples/
MIT License
987 stars 474 forks source link

Are “inline” sessions automatically “paused” when entering “immersive” sessions? #112

Closed jomijomi closed 3 years ago

jomijomi commented 3 years ago

In the Inline Session sample, both the “inline” and “immersive” sessions requests calls to onXRFrame by calling:

session.requestAnimationFrame(onXRFrame);

Now, when creating/entering the "immersive" session I can’t see that the "inline" session is "paused" or put on hold? Are we still receiving “inline” draw events while in the “immersive” session, or is the “inline” session automatically “paused” while we’re in the “immersive” session? (this is on the Oculus Quest browser, if that matters)

Best, Mikael

jomijomi commented 3 years ago

Ok, I think I found the answer to my question at: https://www.w3.org/TR/webxr/#animation-frames

EXAMPLE 3: If an immersive session prevents rendering opportunities...

"Applications which use "inline" sessions for rendering to the HTML document do not need to take any special steps to coordinate the animation loops, since the user agent will automatically suspend the animation loops of any "inline" sessions while an immersive session is active."

So, I interpret this as: On the Quest (standalone) the animation loop for "inline" session(s) WILL be suspended while an "immersive" session is active. HOWEVER, if you have an HMD connected to a PC this may not necessarily hold true...

Is this a correct understanding?

/Mikael

jomijomi commented 3 years ago

This seems to be the case, so I'm closing this now. /Mikael