Three js memory management

后端 未结 2 675
渐次进展
渐次进展 2021-02-04 08:56

I have a large scene with a lot of Mesh and MorphAnimMesh. I want to free memory when the meshes are removed. If i know right this is the best way to do:

for ( v         


        
2条回答
  •  温柔的废话
    2021-02-04 09:39

    I did try all the dispose and deallocate methods but nothing worked.

    Then I did the following for my ionic application which is using webgl renderer to render a 360 image.

    this.renderer = new THREE.WebGLRenderer({ antialias: true });
    RicohView.prototype.stopRendering = function () {
        this.canRender = false;
        this.renderer.forceContextLoss();
        this.renderer.dispose();
        console.log('renderer disposed');
        cancelAnimationFrame(this.requestId);
    }
    

    requestId is something which can be captured from

    this.requestId = requestAnimationFrame(render);
    

提交回复
热议问题