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

Looking Glass WebXR Support #260

Open
BryanChrisBrown opened this issue Mar 21, 2023 · 4 comments
Open

Looking Glass WebXR Support #260

BryanChrisBrown opened this issue Mar 21, 2023 · 4 comments

Comments

@BryanChrisBrown
Copy link

So, this issue is mostly to ask a few questions about the project, specifically around Unity's handling of multiple views as I'm looking to see if it's possible to use this to support the Looking Glass WebXR Library.

It looks like unity currently renders both views to the full framebuffer based on some digging with nvidia nsight,

I've attempted to load the Looking Glass WebXR Library with the Unity WebGL output, and while it does initiate an XR Session it doesn't render beyond two views, this part makes sense because of the way the plugin was written. I'm working on a PR now that remedies this, but was more curious about the full canvas rendering.

The way the Looking Glass WebXR Library works is that it renders a grid of views to the XRWebGLLayer, then runs those through a subpixel shader to render for the Looking Glass display. Currently, the Unity WebGL build seems to render the views to the full framebuffer, rather than the specific quadrant associated with a view, is this something baked into unity, or something that can be configured with how the WebXR Exporter is handled?

Thanks!

@De-Panther
Copy link
Owner

As Unity is a closed box, the simplest solution was to send the views to the full framebuffer.

I guess you already looked at webxr.jspre.
Some pointers that might help,
Look where we override bindFramebuffer.
And at the start of XRManager.prototype.animate.

Notice that Unity's JS minimizer on some versions supports only ES5, so newer JS syntax won't work in the jspre file.

@De-Panther
Copy link
Owner

Any updates? Or things that I can change that would help with this implementation?

@BryanChrisBrown
Copy link
Author

I did try building out a basic implementation in unity to test performance. One of the issues that I ran into was unity's webGL / WASM output being limited to a single-thread, rendering 48 cameras at once is much slower than in native builds.

I briefly tried looking into some optimizations for it, but didn't have too much luck and sort of left it at that for the time being.

@De-Panther
Copy link
Owner

I tried to look if there's open source Looking Glass Unity package, but it seems that I need to download a .unitypackage file...
How does the current Looking Glass Unity support works? Number of Cameras? Render Textures? XR SDK?

I recently added support for Unity XR SDK to WebXR Export, but sadly there's no Single Pass or Multiview support for web.
I wonder how the current non-web support for Looking Glass handles the rendering of so many views.

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