Shadows - VSMShadowMap not working

In my desire to familiarize myself with the entirety of the three.js source code, see how some things are done, and then attempt to re-create them myself, I managed to stumble upon an issue with the VSMShadowMap. For whatever reason, whenever I don’t have VSMShadowMap set as the shadow map type before the first render frame, and then try to switch the shadow map type to VSM, and update the shadow map, this happens.

Here is a fiddle that I made for messing around.

This is actually a bug in three.js. The engine assumes VSM is used right from the beginning. A runtime error occurs if you switch to it from a different shadow map type. Let me fix this with a PR.

1 Like