You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The immersive-web WebXR polyfill that looking-glass-webxr extends appears to define an independent animation loop to constantly run in the background. LookingGlassXRDevice hooks into this loop with onFrameStart and onFrameEnd to perform operations such as clearing the framebuffer here on each frame.
The background WebXR animation loop is reasonable for head-mounted displays where the view perspective changes constantly. By contrast, a Looking Glass hologram could be static while a user is not interacting with it. In that case re-rendering on each frame is redundant.
There does not appear to be a clear way to tell the Looking Glass polyfill to persist the last rendered quilt across frames. Under the current implementation 1) the WebXR animation loop always runs and 2) LookingGlassXRDevice clears the quilt framebuffer on each frame.
Requested Change
Rather than tackle the WebXR animation loop, it would be helpful for the Looking Glass polyfill public API to accept a parameter indicating whether the next frame will be a "new" quilt or should preserve the previous quilt. This should be able to be programmatically updated via an external application or library.
For instance, we should be able to tell the LookingGlassXRDevice that the user is interacting with a scene and we will re-render on each frame, or that the user is not interacting with a static scene and we want to reuse the previous hologram.
The text was updated successfully, but these errors were encountered:
if you're able I'd appreciate your help with this one, sounds like a great improvement to the library and it'd save some battery life.
one thing I wonder is if this would affect animated scenes with moving objects or other live effects, it's likely we'd need to add a setting for this in the config that would allow us to decide to drive the frames from user input or automatically. This would be similar to react-three-fiber's frameLoop parameter.
Thanks @BryanChrisBrown , my time is limited right now but I'll see what I can do. Great reference, yes, frameLoop sounds very much like the setting that would be needed here.
Background
The
immersive-web
WebXR polyfill thatlooking-glass-webxr
extends appears to define an independent animation loop to constantly run in the background.LookingGlassXRDevice
hooks into this loop withonFrameStart
andonFrameEnd
to perform operations such as clearing the framebuffer here on each frame.The background WebXR animation loop is reasonable for head-mounted displays where the view perspective changes constantly. By contrast, a Looking Glass hologram could be static while a user is not interacting with it. In that case re-rendering on each frame is redundant.
There does not appear to be a clear way to tell the Looking Glass polyfill to persist the last rendered quilt across frames. Under the current implementation 1) the WebXR animation loop always runs and 2)
LookingGlassXRDevice
clears the quilt framebuffer on each frame.Requested Change
Rather than tackle the WebXR animation loop, it would be helpful for the Looking Glass polyfill public API to accept a parameter indicating whether the next frame will be a "new" quilt or should preserve the previous quilt. This should be able to be programmatically updated via an external application or library.
For instance, we should be able to tell the
LookingGlassXRDevice
that the user is interacting with a scene and we will re-render on each frame, or that the user is not interacting with a static scene and we want to reuse the previous hologram.The text was updated successfully, but these errors were encountered: