-
-
Notifications
You must be signed in to change notification settings - Fork 382
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
feat(WebXR): Support rendering to Looking Glass holographic displays #2669
Conversation
Hi @floryst , would you please take a look and let me know what I'm doing wrong in this branch? Attempting to use Once I can get the polyfill loaded for testing I can move forward with adjusting OpenGL WebXR rendering to create the LookingGlass quilt for display. |
It looks like that exports a module and does not register a global |
@floryst Thanks for the feedback. When I try to use a dynamic import
then compile
I get an error
From what I can find online the https://babeljs.io/blog/2019/07/03/7.5.0 Any thoughts on how to proceed? |
Try the following: |
It looks like that worked, excellent. I am able to load and instantiate the polyfill from the module. Thank you @floryst ! |
c9b1b78
to
0f60eab
Compare
0f60eab
to
91ad837
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me.!
I'm definitely interested in seeing what we can do to improve this on the Looking Glass side, in general our goal is to make it as easy and straightforward as possible to integrate our WebXR Library with any WebGL framework. The connection between the rendered canvas dimensions and the framebufferwidth has definitely hit us before and there are a few approaches we've been looking at as possible alternatives, like offScreenCanvas. The most interesting one to me currently is using Virtual WebGL Contexts to improve the rendering between the two different webGL contexts we're using with the library. On the babel side of things, we have an open issue to investigate a non-module based build option. This was primarily for adding support for global namespaces as frameworks like PlayCanvas and Babylon.JS still commonly use it. I am glad to see you were able to find a solution for this in your build tool but would love to make it more streamlined for you. Would providing a version of the library with global namespaces improve the integration on your end? |
@BryanChrisBrown Yes definitely, thanks for your work on the WebXR polyfill so far. I've opened an issue at Looking-Glass/looking-glass-webxr#35 to track the scissor test issue we've addressed here, that would be a small change with major impact on integration.
The variable framebuffer size may have contributed to debugging difficulties in 0.3.0 but does not seem to have been the root cause of issues. In general it is nice to control the number of views for performance, but the fixed quilt size in 0.4.0-alpha.3 is also valuable for debugging. Is it possible to support both options?
A version with global namespaces would be an integration improvement, but not strictly necessary. The solution @floryst described is sufficient for using the module-based option in our case. |
91ad837
to
37af25f
Compare
I think we could figure something out with the API to support both options, it sounds like the main thing you want to do is reduce the view count correct? I think we can use the quilt presets to set the
Glad to hear the current solution is sufficient, It's likely the global namespace work won't occur until v0.5 which will start work after v0.4 is released. |
Replaces RenderWindow boolean "isAR" parameter with enumerated list of XR session types. Updates internal logic and examples to use enumerated session types in place of simple "isAR" checks. These changes are introduced as a prerequisite for adding Looking Glass support as a third type of XR session. Changes are technically API breaking, though consuming projects using VR == 0, AR == 1 implicit enumerated values are unlikely to see changes in project behavior.
fc6fd89
to
3f64bda
Compare
Updated WebXR volume rendering examples with Looking Glass support and rebased on |
Yes, having a default number of views that can be overridden would address the issue. This PR will adapt several of our existing examples for vtk.js WebXR support to run on Looking Glass, including several that are severely processing intensive. As you've said, diminishing the number of views improves scene responsiveness at the cost of the holographic quality. Once this PR is merged you could try out cinematic volume rendering on the Looking Glass here: https://kitware.github.io/vtk-js/examples/WebXRHeadFullVolumeCVR.html
Sure, that sounds good. |
3f64bda
to
7af3b5e
Compare
I'm still playing with the head and neck data to reduce its size (between
meetings). Give me a few more minutes, and perhaps we can include it as
an option?
s
…On Tue, Feb 28, 2023 at 12:04 PM Tom Birdsong ***@***.***> wrote:
@floryst <https://github.com/floryst> @aylward
<https://github.com/aylward> I've included updates to add Looking Glass
support to existing WebXR examples, ready for re-review and merge.
—
Reply to this email directly, view it on GitHub
<#2669 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AACEJL6WE323VLUSD5B3RC3WZYV27ANCNFSM6AAAAAATZNSUAQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
--
Stephen R. Aylward, Ph.D.
Senior Director of Strategic Initiatives
Chair of MONAI Advisory Board
---
Kitware: *Delivering innovation.*
|
7af3b5e
to
3d4b35c
Compare
Added a WebXRVolume link to load ultrasound fetus volume data from VolView sample data set, in .vti format https://data.kitware.com/#collection/586fef9f8d777f05f44a5c86/folder/634713cf11dab81428208e1e |
Added @aylward 's Head_And_Chest volume with "CT-AAA" presets, please take a look. |
9136aa7
to
a8167da
Compare
Adds support for rendering to Looking Glass holographic display via Looking Glass WebXR polyfill. View transforms provided by the Looking Glass WebXR polyfill are retrieved each frame and used to render into a quilt to be copied onto the Looking Glass external display. xref https://lookingglassfactory.com/webxr xref https://docs.lookingglassfactory.com/keyconcepts/quilts
Adds new example for rendering to Looking Glass holographic display with the Looking Glass WebXR polyfill. The example is a port of the existing VR cone example that explicitly fetches and loads the Looking Glass polyfill. xref https://docs.lookingglassfactory.com/developer-tools/webxr co-authored-by: Forrest Li <[email protected]>
Changes: - Adds `xrSessionType` URL parameter to allow user requested session - Fetch and use Looking Glass polyfill on request - Adds holographic section to documentation - Adds reference to 3DUS-Fetus.vti ultrasound data sample
Adds Looking Glass WebXR support to two WebXR cinematic rendering examples. Note that the number of views is intentionally constrained in `WebXRHeadFullVolumeCVR` to address observed performance issues. `WebXRChestCTBlendedCVR` is excluded from changes due to image size and subsequent rendering performance.
Adds "xrSessionType" URL parameter with Looking Glass option.
Adds Looking Glass section to gallery of existing WebXR examples.
59c6b4c
to
c8fca3c
Compare
@floryst I've addressed comments and squashed WebXRVolume commits. Ready for me to merge? |
LGTM! |
🎉 This PR is included in version 26.8.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Adds support for rendering to Looking Glass holographic display via Looking Glass WebXR polyfill.
View transforms provided by the Looking Glass WebXR polyfill are retrieved each frame and used to render into a quilt to be copied onto the Looking Glass external display.
Includes minor breaking changes to the OpenGL RenderWindow API where the "isAR" boolean is replaced with an enum for the XR session type to request.
Context
See Looking Glass support under (4) in the vtk.js WebXR roadmap: #2571
xref https://lookingglassfactory.com/webxr , https://docs.lookingglassfactory.com/keyconcepts/quilts
Results
Scene views are appropriately generated and composited to render a hologram on a Looking Glass Portrait display.
Inline browser view (swizzled):
Inline browser view (quilt):
Changes
XrSessionTypes
enum inRenderWindow/Constants.js
and updatesRenderWindow.startXR
throughout the project and examples to use the new enum definitionsPR and Code Checklist
npm run reformat
Tested On
Windows 10
Chrome 110.0.0.0
vtk.js v26.6.1
Looking Glass WebXR Polyfill v0.3.0 release
Notes
Originally tested with [email protected] pre-release, verified compatibility with 0.3.0 release.
Includes a fix where the WebGL scissor box is reset in
RenderWindow.xrRender
. Rendering otherwise does not reset the scissor box at the end of an animation frame but also the Looking Glass polyfill does not reset the scissor box when settings its viewport. Will follow up with investigation into whether a more sustainable fix is available in the Looking Glass polyfill or in vtk.js.