Three.js: Disabling casting shadows on one from multiple lights crashes the renderer

Created on 23 Oct 2019  ·  3Comments  ·  Source: mrdoob/three.js

Description of the problem

Given a scene that contains multiple light sources, disabling casting shadows on only one of the lights will result with renderer crashing.

StackTrace:

three.js:16521 Uncaught TypeError: Cannot read property 'toArray' of undefined
    at flatten (three.js:16521)
    at PureArrayUniform.setValueM4Array [as setValue] (three.js:16999)
    at Function.WebGLUniforms.upload (three.js:17248)
    at setProgram (three.js:25307)
    at WebGLRenderer.renderBufferDirect (three.js:24041)
    at renderObject (three.js:24802)
    at renderObjects (three.js:24772)
    at WebGLRenderer.render (three.js:24549)
    at render ((index):111)

This problem started occurring from version r108. In r107 the problem does not occur.

Examples:

  • jsfiddle (r109, clicking on 'shadows' will crash the renderer)
  • jsfiddle (r107, clicking on 'shadows' will work properly)
Three.js version
  • [x] r108
  • [x] r108
  • [ ] r107
Browser
  • [x] All of them
  • [ ] Chrome
  • [ ] Firefox
  • [ ] Internet Explorer
OS
  • [x] All of them
  • [ ] Windows
  • [ ] macOS
  • [ ] Linux
  • [ ] Android
  • [ ] iOS
Bug

All 3 comments

Actually, I can not reproduce with latest dev version:

https://jsfiddle.net/ewhgdyk4/1/

@moskopio Can you please verify?

https://jsfiddle.net/pbkx9mwg/ is running using r109 and crash does happen on this version.

However, it does work fine on https://jsfiddle.net/ewhgdyk4/1/ which is using latest dev :+1:

Thank you @Mugen87 !

I'm glad this issue is already resolved :sweat_smile:

Was this page helpful?
0 / 5 - 0 ratings