-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
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
WebGLRenderer: Improve efficiency of transmission pass for WebXR #28078
Conversation
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Awesome! Do you think we can split up the PR so we can review and merge the changes step by step? That would make the review process easier and it's more likely to get changes faster into the core. Can we start with f6a71b2? Regarding this commit, I agree it makes sense to switch from the default drawing buffer size to the current/active viewport when sizing the transmission render target. So this change looks good to me! |
I'm not sure I get 4e9490b yet 😇 . Can we discuss it in a next PR? |
Almost there^^! Only 94bd720 left. |
Closing as all changes are in: |
@mrxz Thank you for this great contribution! And for your patience during the review process^^. Splitting up the change into multiple PRs made it much easier to discuss and integrate everything into the renderer! |
Related issue: #28073 and #22594
Description
This PR attempts to improve the efficiency of the transmission pass (for WebXR). The render targets used were incorrectly sized and rendering was interleaved with the main scene rendering (#22594). See the following before and after logs made using
ovrgpuprofiler
on a Quest 3.Before:
Background clear WebXR buffer -> left eye transmission -> left eye WebXR buffer -> right eye transmission -> right eye WebXR buffer
After:
WebXR buffer (no-op) -> left eye transmission -> right eye transmission -> WebXR buffer (background clear, left and right eye)
The individual changes are kept as individual commits for easier review. It might also make sense to split this up into individual PRs, as while they all serve the same goal, they do stand on their own. In order:
transmissionRenderTarget
based on the current viewport (or would-be viewport for WebXR).renderScene
method, allowing transmission passes for both eyes to be rendered in advance.WebGLBackground
to treat backgrounds that insert themselves into the render list differently from ones causing a clear.WebGLBackground
could perform a clear, but it can also inserts entries in the render list. A clear causes a "StoreColor" and "StoreDepthStencil" when switching to the transmission render target, despite the framebuffer being effectively empty. At the same time the background items are needed in the render list before rendering the transmission pass, so this commit splits the two behaviours.__transmissionRenderTarget
flag with__ignoreDepthValues
as neither depth nor stencil are needed after renderingStoreDepthStencil
from the transmission passes, as the depth isn't needed any more. However it seems that when the multisample RTT extension is used this code path isn't used (i.e.__ignoreDepthValues
has no effect on Quest). A follow-up PR should address this, though I'm not sure what the best place for this logic would be.This contribution is funded by Fern Solutions