Material ignore shadow

Is it possible to tell materials to not receive shadows.
I don´t mean via receiveShadow = true|false, but if you have multimaterials …aka an material´s array [MeshBasicMaterial, ShadowMaterial]

…can I tell f.e. MeshBasicMaterial to ignore shadow, and just use ShadowMaterial´s shadow?

THREE.MeshBasicMaterial() receives shadows?

No, it doesn’t. I believe what @oldsilverback is asking is if he can use the shadow map from one material on another material. My knee-jerk reaction is “no” but I’m not familiar enough with shadows to say definitively.

Sorry, not MeshBasic but THREE.MeshStandardMaterial

Nevertheless that´s not the point. The point was if there´s a param ignoreShadow or some so tell one material in an material´s array (multimaterial) for one mesh to not receive a shadow, whilst just another material receives it.

This way we could use the ShadowMaterial and benefit from it´s opacity param to dim/enlighten shadow´s darkness

Do you mean that would like to have, say, a cube, with a different material on each face, and have shadows on some faces and not on others?

2 Likes

Actually this would be a reasonable addition letting materials decide to cast or receive shadows as well.

There isn’t such an option yet as far as i know, besides changing the code there should be a chance to modify the shaders program after it has been created.

Or in src/renderers/webglWebGLPrograms.js changing line 190

shadowMapEnabled: renderer.shadowMap.enabled && object.receiveShadow && lights.shadows.length > 0,

with

shadowMapEnabled: renderer.shadowMap.enabled && ( object.receiveShadow || ( object.material && object.material.receiveShadow ) ) && lights.shadows.length > 0,

should make it available.