-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Multiview support for webgpu renderer #30920
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
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
src/renderers/common/nodes/Nodes.js
Outdated
| const cacheKey = this.getOutputCacheKey(); | ||
|
|
||
| const output = texture( outputTarget, screenUV ).renderOutput( renderer.toneMapping, renderer.currentColorSpace ); | ||
| //builtin( 'gl_ViewID_OVR' )?? |
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.
@Mugen87 how can I incorporate the view id?
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.
Can you explain why you need to evaluate gl_ViewID_OVR at this place? I've though this built-in is just required to detect the correct camera matrices for the current view.
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.
Because we rendered to a multiview rendertarget in the first step and are rendering to the multiview xr target, we need to select the right texture in the texture array.
Without using gl_ViewID_OVR, the fragment shader will always pick the texture for the left eye.
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.
@Mugen87 I fixed this in my latest diff. It was easier than I thought :-)
This node system is quite the change! Very nice
|
I'll pushed some code clean up and additions to the documentation. |
f3eaba2 to
aac046b
Compare
|
@Mugen87 I don't understand why the perlin example keeps failing... |
00efce1 to
b7250c8
Compare
Found the issue. I've introduced a bug when refactoring |
|
|
||
| this.setFoveation( this.getFoveation() ); | ||
|
|
||
| this._referenceSpace = await session.requestReferenceSpace( this.getReferenceSpaceType() ); |
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.
#30902 has moved this line so the non-layers code path uses requestReferenceSpace() as well.
If you revert the PR, I guess we have to copy the line into the non-layer else block.
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.
thanks! I added it to the other path.
|
Okay, CI runs now as expected 🎉 ! |
awesome! I tested both xr test files so if we're in the green I think we're all set. |
|
@cabanier Fantastic work! |
* Add support for multiview * support multi-pass with webxr multiview * update fragment shader for multiview * Clean up. * Update XRManager.js * address review comment for multiview rendering * more cleanup + fixes for multiview * fix webxr layers bug + enabled multiview in native layers sample * Update WebGLTextureUtils.js * Update RenderTarget.js * remove test code * fix reference space for non-layers path --------- Co-authored-by: Mugen87 <[email protected]>
* Add support for multiview * support multi-pass with webxr multiview * update fragment shader for multiview * Clean up. * Update XRManager.js * address review comment for multiview rendering * more cleanup + fixes for multiview * fix webxr layers bug + enabled multiview in native layers sample * Update WebGLTextureUtils.js * Update RenderTarget.js * remove test code * fix reference space for non-layers path --------- Co-authored-by: Mugen87 <[email protected]>
Related issue: #20368, #28968
This contribution is funded by Meta