Hi there,
I found that renderer.shadowMap.type=VSMShadowMap
seems to have an issue in regards to 3D objects which are set to receiveShadow=true and castShadow=false.
In this fiddle you can see
https://jsfiddle.net/Thor_Bux/g1Loqb08/21/
That the red cube is set to castShadow=false and receiveShadow=true however if the shadowMap.type is set to VSMShadowMap it also casts a shadow.
If the shadowMap.type is set to another type like PCFSoftShadowMap it works as expected. (See line 125, 126)
It looks like that's due to this part of the condition in WebGLShadowMap on line 392 when determining whether or not to render an object:
object.castShadow || ( object.receiveShadow && type === VSMShadowMap )
I'm not sure why that second portion was added, though.
/ping @supereggbert
This is a limitation of VSM. The algorithm requires the depth of the scene for both casters and receivers for the maths to work out correctly. If you don't render receivers, it leads to some weird behaviour (normally skinny hard shadows).
This is a limitation of VSM.
Oh good to know! Maybe it would be worth adding a note in the docs on the Renderer Constants page?
Most helpful comment
Oh good to know! Maybe it would be worth adding a note in the docs on the Renderer Constants page?