0

So I have a situation where I have a webglRenderer and a scene and I am adding and removing lights from the scene. After adding 5 lights and removing them enough times, the renderer will crash because too many lights are registered in the webglRenderer. What I want to be able to do is reset the current number of lights value in the THREE.js webglRenderer when I remove the lights from the scene, so this problem does not happen. I was wondering if anyone knew how to do this or which variable I should be looking at in the THREE.js global scope.

I should note, that I have many objects that are also being added and removed along with the lights.

-Freddie

4

1 回答 1

0

不建议您这样做。

在 Wiki 文章How to Update Things with WebGLRenderer中,它解释了在运行时(一旦材质至少渲染一次)无法轻易更改的属性包括光的数量和类型

本文还提供了建议的解决方法。

三.js r.60

于 2013-08-20T01:55:02.677 回答