Skip to content
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

Feature Request: Persist Last Rendered Hologram #41

Open
tbirdso opened this issue Oct 26, 2023 · 2 comments
Open

Feature Request: Persist Last Rendered Hologram #41

tbirdso opened this issue Oct 26, 2023 · 2 comments

Comments

@tbirdso
Copy link

tbirdso commented Oct 26, 2023

Background

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.

@BryanChrisBrown
Copy link
Collaborator

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.

@tbirdso
Copy link
Author

tbirdso commented Nov 7, 2023

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants