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

WebGLRenderer: Prerender transmission pass(es) #28097

Merged
merged 3 commits into from
Apr 11, 2024

Conversation

mrxz
Copy link
Contributor

@mrxz mrxz commented Apr 9, 2024

Related issue: #22594 (split off from #28078)

Description
Rendering the transmission pass happened at the start of renderScene. In case of WebXR the scene is rendered twice sequentially, once for the left eye and once for the right eye. This resulted in the corresponding transmission passes to be interleaved with the main rendering (see ovrgpuprofiler output in #28078 and #22594). These additional switches cause expensive flushes to, and loads from main memory.

This PR moves the rendering of the transmission pass before renderScene. For WebXR this allows the transmission buffer to be rendered for the left and right eye in succession, after which the left and right eye can be rendered as normal without needing to switch render target in-between.

This contribution is funded by Fern Solutions

Copy link

github-actions bot commented Apr 9, 2024

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
672.9 kB (166.8 kB) 673.1 kB (166.8 kB) +183 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
452.6 kB (109.3 kB) 452.8 kB (109.4 kB) +183 B

@Mugen87 Mugen87 added this to the r164 milestone Apr 10, 2024
@Mugen87 Mugen87 merged commit 185af48 into mrdoob:dev Apr 11, 2024
12 checks passed
@Mugen87
Copy link
Collaborator

Mugen87 commented Apr 11, 2024

/ping @cabanier #22595 eventually landed although with a slightly different implementation. The performance improvements are in place though 🎉 .

@cabanier
Copy link
Contributor

Very nice! Do we need the depth buffer data from the transmission pass? If not, you can discard it at the end of the transmission pass of each eye so the GPU doesn't have to resolve it.

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

Successfully merging this pull request may close these issues.

3 participants