Skip to content

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.

@github-actions
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
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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant