I want to dynamically change the resolution of the shadows of a spotlight in THREE.js. This question first seems relevant but it is not about my issue. I change the parameters of shadowmap dynamically but this is not affecting the scene. Even when I add more mesh objects after this, it does not affect the shadows in the scene/light. When I use an initial value (256,256), it is applied but not after showing the scene.
light.shadowMapWidth = 2048;
light.shadowMapHeight = 2048;
I tries the following but it didn't work:
light.shadowMap.setSize(100,100)
When I change the light.position, the shadow is updated but the resultion is not updated. It seems to use the .shadowMapWidth property in the beginning during the initialisation only.