Description
In order to build a selective real time shadow along with a baked shadow system the light.shadow.camera should honor the layers to be tested against an object to render the shadow
I did add support on a custom build of the WebGLRenderer and this was very handy
Here an example disabling all the layers for the shadow camera but still renders :
Live Link
Solution
Before rendering the shadow, the mask is copied from the main render camera, wondering if this copy is mandatory, and if we could go with manually setting the layers instead for more controls, or maybe provide a solution to play with the shadow.camera layer without being overwritten :
|
shadow.camera.layers.mask = camera.layers.mask; |
Description
In order to build a selective real time shadow along with a baked shadow system the light.shadow.camera should honor the layers to be tested against an object to render the shadow
I did add support on a custom build of the WebGLRenderer and this was very handy
Here an example disabling all the layers for the shadow camera but still renders :
Live Link
Solution
Before rendering the shadow, the mask is copied from the main render camera, wondering if this copy is mandatory, and if we could go with manually setting the layers instead for more controls, or maybe provide a solution to play with the shadow.camera layer without being overwritten :
three.js/src/nodes/lighting/ShadowNode.js
Line 659 in 672d77a