Currently the shadow camera of SpotLight (actually its fov property) is coupled to the light's angle. So doing this:
spotLight.shadow.camera.fov = 45;
has no effect. Thus it is not possible to configure a smaller shadow frustum when having a large spot light cone.
The workaround for this use case is to overwrite SpotLight.shadow with an new instance of the internal LightShadow class. This prevents the execution of SpotLightShadow.updateMatrices() which is responsible for the mentioned fov/angle coupling.
One possible solution for this issue was outlined here: https://github.com/mrdoob/three.js/pull/20147#issuecomment-679092113
The idea is to introduce a new boolean property called SpotLightShadow.autoFOV. If set to false, the existing coupling is disabled so setting SpotLightShadow.fov actually has an effect.
Implementing this solution or an alternative would make it possible to prevent the export of LightShadow (which shouldn't be public). In general, a light's shadow property should be considered as read-only and not overwritten by the user.
Implementing this solution or an alternative would make it possible to prevent the export of LightShadow (which shouldn't be public)
Agreed. Please see #20218 for an alternative.
Now that #20218 is merged should be okay to remove LightShadow from the exports?
Finally solved 馃槄 .
Most helpful comment
Now that #20218 is merged should be okay to remove
LightShadowfrom the exports?