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

WebGLRenderLists retaining unused heap objects #11478

Closed
2 of 11 tasks
aardgoose opened this issue Jun 9, 2017 · 4 comments
Closed
2 of 11 tasks

WebGLRenderLists retaining unused heap objects #11478

aardgoose opened this issue Jun 9, 2017 · 4 comments

Comments

@aardgoose
Copy link
Contributor

aardgoose commented Jun 9, 2017

Description of the problem

A problem with the new WebGLRenderLists which are hashed by Scene and Camera objects.

If a scene and or camera is used in a render pass, but is then not needed and discarded afterwards, the RenderLists retain references to the camera and scene objects and descendants, thus preventing garbage collection and the obvious problems with memory usage. The only mechanism available to delete the renderLists is to dispose of the renderer and start again which seems a bit extreme, and not always practical.

Should this be:

  1. Ignored, as an obscure corner case. ( I hit it, but am probably not a typical user).

  2. Add a mechanism to remove all or a specific WebGLRenderList.

  3. Use listeners on Scene and Camera dispose events or similar to remove RenderLists. ( probably the most complicated and error prone).

Any thoughts on this?

Three.js version
  • [X ] Dev
  • [ X] r85
  • ...
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, ...)
@mrdoob
Copy link
Owner

mrdoob commented Jun 9, 2017

If a scene and or camera is used in a render pass, but is then not needed and discarded afterwards,

You mean is not needed for the rest of the application? Or do you create a new camera later?

@aardgoose
Copy link
Contributor Author

In this case it is a camera used for a once only rtt pass and not used later, (Orthographic and Perspective cameras in use, so I can't use a single camera and recycle, so I end up with effectively orphaned render lists, if that makes sense.

@mrdoob
Copy link
Owner

mrdoob commented Jun 10, 2017

Yeah. Makes sense. I think I would vote for exposing renderer.renderLists.

@aardgoose
Copy link
Contributor Author

Closed by #11497

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants