Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Jan 4, 2019

Fixes #15485

@aardgoose
Copy link
Contributor

Do you want to also dispose of the references to objects maintained in WebGLRenderLists, similarly keyed by scene.id and camera.id.

Or should render lists be added to the WebGLRenderStates to avoid duplication of code etc even?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 4, 2019

Let's just add onSceneDispose() in WebGLRenderLists.

@joshpatt2
Copy link

Thanks for doing this!!!

@mrdoob
Copy link
Owner

mrdoob commented Jan 7, 2019

Beautiful!

@mrdoob mrdoob added this to the r101 milestone Jan 7, 2019
@mrdoob mrdoob merged commit 3f5991e into mrdoob:dev Jan 7, 2019
@mrdoob
Copy link
Owner

mrdoob commented Jan 7, 2019

Thanks!

@mrdoob
Copy link
Owner

mrdoob commented Jan 7, 2019

Does this make #12464 redundant?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Jan 8, 2019

Unfortunately no. Scene.dispose() is intended to dispose a complete scene object. For instance if an app wants to render a different scene than before, users can call this new method in order to clean up related data cached by WebGLRenderer.

#12464 tries to ensures that disposed materials and geometries are actually removed from memory. Because of how WebGLRenderLists works, this is not always the case. Calling Scene.dispose() would solve this issue but it feels strange to dispose a scene if you are still going to use it. Because of this, I think we should resolve the conflicts in #12464 and merge it.

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.

4 participants