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

WebGLBackground: Reset meshes in dispose(). #30257

Merged
merged 1 commit into from
Jan 3, 2025
Merged

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 3, 2025

Fixed #30230.

Description

When renderer.dispose() is called, the background's dispose() method is called as well since r171. If a renderer is used after renderer.dispose() which is true for the editor, the background wasn't functional anymore. To force a call of WebGLObjects.update(), WebGLBackground.dispose() simplify removes the references to its internal meshes which is also the more correct implementation.

It is open for debate if using a renderer after dispose() is valid but this PR restores the behavior before r171.

@Mugen87 Mugen87 added this to the r173 milestone Jan 3, 2025
Copy link

github-actions bot commented Jan 3, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 339.47
79.08
339.49
79.09
+18 B
+5 B
WebGPU 489.82
135.88
489.82
135.88
+0 B
+0 B
WebGPU Nodes 489.29
135.76
489.29
135.76
+0 B
+0 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.33
112.13
465.35
112.14
+18 B
+7 B
WebGPU 559.3
151.37
559.3
151.37
+0 B
+0 B
WebGPU Nodes 515.38
141.15
515.38
141.15
+0 B
+0 B

@Mugen87 Mugen87 merged commit 880d23e into mrdoob:dev Jan 3, 2025
12 checks passed
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.

Player in the Editor does not display background image
1 participant