-
Notifications
You must be signed in to change notification settings - Fork 377
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
Which timestamp should be used for frame callbacks? #943
Comments
The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225
The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225
The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225
The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225
The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225
It seems like we want the timestamp to be the time the frame occurred (like other non-xr rAF callbacks), not any predicted frame display time. That said, this still leaves open the question of whether we should be providing predicted frames at all. Currently the spec talks of the "time represented by the XRFrame", which doesn't use XRFrame/time (this is an oversight). If we do this it may be worth adding something that lets you access the |
Automatic update from web-platform-tests Update webxr timestamp test to not compare against window.rAF() The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225 -- Fix xrDevice_requestSession_no_mode to test for a throw, not a rejection -- Allow spawning inline sessions without interaction -- wpt-commits: be18a267fd4eaac9228ce681c68b3f7fa73d19e3, e9a537ff548399c0ff48f4d554081a86af30fb56, 39bacd5cc2180c62ca0468e646be16f81f353f28 wpt-pr: 20737
Automatic update from web-platform-tests Update webxr timestamp test to not compare against window.rAF() The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225 -- Fix xrDevice_requestSession_no_mode to test for a throw, not a rejection -- Allow spawning inline sessions without interaction -- wpt-commits: be18a267fd4eaac9228ce681c68b3f7fa73d19e3, e9a537ff548399c0ff48f4d554081a86af30fb56, 39bacd5cc2180c62ca0468e646be16f81f353f28 wpt-pr: 20737 UltraBlame original commit: c6dbb106ae576d0dae4ef26b2de2a6d892ec3880
Automatic update from web-platform-tests Update webxr timestamp test to not compare against window.rAF() The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225 -- Fix xrDevice_requestSession_no_mode to test for a throw, not a rejection -- Allow spawning inline sessions without interaction -- wpt-commits: be18a267fd4eaac9228ce681c68b3f7fa73d19e3, e9a537ff548399c0ff48f4d554081a86af30fb56, 39bacd5cc2180c62ca0468e646be16f81f353f28 wpt-pr: 20737 UltraBlame original commit: c6dbb106ae576d0dae4ef26b2de2a6d892ec3880
Automatic update from web-platform-tests Update webxr timestamp test to not compare against window.rAF() The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225 -- Fix xrDevice_requestSession_no_mode to test for a throw, not a rejection -- Allow spawning inline sessions without interaction -- wpt-commits: be18a267fd4eaac9228ce681c68b3f7fa73d19e3, e9a537ff548399c0ff48f4d554081a86af30fb56, 39bacd5cc2180c62ca0468e646be16f81f353f28 wpt-pr: 20737 UltraBlame original commit: c6dbb106ae576d0dae4ef26b2de2a6d892ec3880
Automatic update from web-platform-tests Update webxr timestamp test to not compare against window.rAF() The exact desired behavior is unclear, see immersive-web/webxr#943 and immersive-web/webxr#225 -- Fix xrDevice_requestSession_no_mode to test for a throw, not a rejection -- Allow spawning inline sessions without interaction -- wpt-commits: be18a267fd4eaac9228ce681c68b3f7fa73d19e3, e9a537ff548399c0ff48f4d554081a86af30fb56, 39bacd5cc2180c62ca0468e646be16f81f353f28 wpt-pr: 20737
/agenda we should pick something here |
Hm. We talked about this in the past and I'm pretty certain that we decided that the timestamp passed to the callback would basically be the same timestamp that would have been passed to a standard rAF that would have happened at the same time. (I don't know the technical way to express this off the top of my head.) This was primarily so that content that switched between At the time we also decided that any XR specific timing values would be better communicated through the frame. ( |
I don't remember talking about this, but the only timestamp that makes sense, IMNSHO, is the one that corresponds as closely as possible to the time of the frame on the underlying XR platform. Using some purposely wrong timestamp just to satisfy such an odd requirement seems wrong to me; how often do you expect this switch to happen? How often do you expect it to happen without other major changes to the display (going in/out of AR/VR mode)? |
Apologies for the slow reply, but the issue where we previously discussed this was #347. The proposal I made above was specifically made in theis comment #347 (comment) and it got widespread approval at the time. (Including from one @blairmacintyre who replied "I like this, thanks @toji. I'm especially in favor of having the rAF parameter behave as you describe." 😉) From that thread it sounds like the while the timestamp behavior was updated in the explainer (you can read the text in the "Main Render Loop" section) we didn't pull the same description over into the spec text. Sorry for that! Now that thread is two years old, and so opinions may have shifted regarding the conclusions we came to since then, but for the record I'm still in favor of that general plan and would like to see the spec updated with a more rigorous definition for the timestamp that matches the explainer's behavior and then a renewed look at what XR-specific timing values we can usefully expose to developers on the frame. |
Seems good to me, think we should help-wanted this with a link to that explainer section? |
Agreed. The primary task is to translate the behavior from the explainer into spec text. Sepcifically:
Then as a follow-up we should have an issue to track what other useful timing values we can expose as attributes of an |
@toji I think what I was agreeing with was essentially two things:
Did anything happen similar to the The frame time != when the rAFs start running, and any non-trivial math based on trying to interpolate or infer things across frames for AR/VR sensing is going to be hopeless if we don't have accurate values for when those poses and other frame data occured. If the only time value we have is the time the rAF's started executing, that's a problem. Even at the native level, for example, tools like "ARToolkit" (or other application-level AR sensing apps) could never do proper sensor fusion on most platforms because they had no accurate estimate of when the video frames (and, thus, the poses extracted from them) were acquired. Most of these libraries used the application level time that they received the video frame, which was wildly inaccurate when compared to the time stamps from the inertial sensors. The reason ARKit/ARCore/etc work is because all of this stuff is being done inside the OS with accurate timing, and that time value is being passed up into the app with the data; if we throw out that timing info, there are a host of things native apps will be able to do that web apps never will. |
Some XR APIs, when providing a frame will provide the predicted display timestamp, i.e. the timestamp at the expected time of display. I believe they also provide the predicted frame for that time. For example, openxr does this
When we're working with predicted frames, should the timestamp of the callback be in the future?
The text was updated successfully, but these errors were encountered: