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

WebGPURenderer: Add setOutputRenderTarget() #30459

Merged
merged 5 commits into from
Feb 7, 2025
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Feb 5, 2025

Related issue: #30387 (comment)

Description

The PR introduced Renderer.setOutputRenderTarget() which is focused on screen output, making it less confusing to use RenderTargets and initial support for PostProcessing in XRManager.

@sunag sunag added this to the r174 milestone Feb 5, 2025
Copy link

github-actions bot commented Feb 5, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.12
78.22
336.12
78.22
+0 B
+0 B
WebGPU 516.99
143.53
517.38
143.74
+389 B
+209 B
WebGPU Nodes 516.45
143.43
516.84
143.63
+389 B
+201 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.17
112.09
465.17
112.09
+0 B
+0 B
WebGPU 588.99
159.73
589.27
159.82
+285 B
+92 B
WebGPU Nodes 544.35
149.29
544.64
149.38
+285 B
+90 B

@mrdoob
Copy link
Owner

mrdoob commented Feb 5, 2025

Should we call it setOutputRenderTarget()?

@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 5, 2025

If the parameter is always a render target, I would adhere to the set*RenderTarget() syntax.

To clarify the name setXRTarget(): I've not use setXRRenderTarget() since the parameter is not a render target but a plain framebuffer in WebGL (it's not yet clear to me how the XR target looks like in WebGPU).

@sunag sunag changed the title WebGPURenderer: Add setOutputTarget() WebGPURenderer: Add setOutputRenderTarget() Feb 5, 2025
@sunag sunag marked this pull request as ready for review February 6, 2025 18:16
@sunag sunag merged commit 9f0b854 into mrdoob:dev Feb 7, 2025
12 checks passed
@sunag sunag deleted the dev-output-target branch February 7, 2025 02:44
@Mugen87
Copy link
Collaborator

Mugen87 commented Feb 11, 2025

There is one remaining issue: After this PR when leaving a XR session, webgpu_xr_cubes is rendered in the Quest Browser window black. And when re-entering the XR session, the scene isn't rendered in XR anymore as well. You just see the pass-through view.

There are no warnings/errors in the browser console so I suspect the engine does not properly detect the render target state change.

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