You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After an object was removed from scene, it is still referenced by renderItems. I clear renderItems as below. But the object may be referenced by opaque or transparent. Once I clear opaque and transparent, nothing is rendered(only background color)! I don't how to get it fixed. Could you please double check if the original code is correct and if not how to fix it?
`function WebGLRenderList() {
var renderItems = [];
var renderItemsIndex = 0;
var opaque = [];
var transparent = [];
function init() {
renderItemsIndex = 0;
opaque.length = 0;
transparent.length = 0;
# renderItems = [];
}`
Three.js version
r88
The text was updated successfully, but these errors were encountered:
Usnul, in my project, threejs objects will be added to and removed from scene frequently. Once I remove them from scene, I suppose that they should be not referenced by THREE. But when I use Chrome dev tool to take a snapshot, I found "renderItems" still kept some of them.
The above code only assigns zero to renderItemsIndex, but doesn't make renderItems empty. I think it causes the "memory leak".
After an object was removed from scene, it is still referenced by renderItems. I clear renderItems as below. But the object may be referenced by opaque or transparent. Once I clear opaque and transparent, nothing is rendered(only background color)! I don't how to get it fixed. Could you please double check if the original code is correct and if not how to fix it?
Three.js version
The text was updated successfully, but these errors were encountered: