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

WebGLBackend: Fix depth regression. #30527

Merged
merged 1 commit into from
Feb 15, 2025
Merged

WebGLBackend: Fix depth regression. #30527

merged 1 commit into from
Feb 15, 2025

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 15, 2025

Fixed #30526.

Description

#30413 was intended as a performance optimization for the WebGL backend however there are scenarios where no intermediate framebuffer is used (e.g. when using linear-srgb as output color space). Because color space and tone mapping settings can change at any time, the context must honor the initial renderer attributes.

Unfortunately, that means most apps will have a depth buffer attached to the default framebuffer although it isn't required.

@Mugen87 Mugen87 added this to the r174 milestone Feb 15, 2025
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.42
78.33
336.42
78.33
+0 B
+0 B
WebGPU 518.01
143.8
518.03
143.8
+25 B
+3 B
WebGPU Nodes 517.48
143.69
517.5
143.69
+25 B
+2 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.41
112.17
465.41
112.17
+0 B
+0 B
WebGPU 589.88
159.76
589.91
159.77
+25 B
+3 B
WebGPU Nodes 545.25
149.23
545.27
149.23
+25 B
+3 B

@Mugen87 Mugen87 merged commit 1805ecd into mrdoob:dev Feb 15, 2025
12 checks passed
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 15, 2025

@sunag I wonder if it wouldn't better to always have a framebuffer target, even when using no tone mapping and color space conversion. That would make the setup of the default framebuffer easier and a bit more performant for most use cases (since we could save depth and stencil and MSAA).

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.

WebGPURenderer: Interference between LinearSRGBColorSpace and z-buffer in WebGL2 backend of r173
1 participant