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

WebGLShadowMap: Dispose of unique depth/distance materials. #27326

Merged
merged 3 commits into from
Dec 6, 2023

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Dec 6, 2023

Related issue: -

Description

WebGLShadowMap creates unique depth/distance materials for shadow map rendering when certain conditions are met. This PR ensures these internal materials are removed when the respective dispose() is called on the actual material. Otherwise a memory leak can occur.

Copy link

github-actions bot commented Dec 6, 2023

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
669.3 kB (166.1 kB) 669.4 kB (166.2 kB) +175 B

🌳 Bundle size after tree-shaking

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

Filesize dev Filesize PR Diff
450.3 kB (109.1 kB) 450.4 kB (109.1 kB) +175 B
@Mugen87 Mugen87 added this to the r160 milestone Dec 6, 2023
@Mugen87 Mugen87 merged commit 0e05430 into mrdoob:dev Dec 6, 2023
12 checks passed
AdaRoseCannon pushed a commit to AdaRoseCannon/three.js that referenced this pull request Jan 15, 2024
…7326)

* WebGLShadowMap: Dispose of unique depth/distance materials.

* Update WebGLShadowMap.js

Fix comment.

* Update WebGLShadowMap.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant