I’m trying to conditionally let lights affect materials (presence of lightMap), but setting lights = false
on MeshStandardMaterial
yields errors and the mesh disappears from the scene.
The following error is thrown at ~3 errors per second:
three.module.js:11061 Uncaught TypeError: Cannot read property 'toArray' of undefined
at flatten (three.module.js:11061)
at PureArrayUniform.setValueV3fArray [as setValue] (three.module.js:11400)
at Function.push../node_modules/three/build/three.module.js.WebGLUniforms.upload (three.module.js:11628)
at setProgram (three.module.js:16866)
at WebGLRenderer.renderBufferDirect (three.module.js:16068)
at renderObject (three.module.js:16535)
at renderObjects (three.module.js:16516)
at WebGLRenderer.render (three.module.js:16393)
at Viewer.render (Viewer.js:80)
at Viewer.js:70
I’m not sure if this is a Three.JS bug or a bug in my code but i wouldn’t know where to go from here.
Greetings,
Michael