The white plane does not receive shadows

The white plane does not receive shadows.

window.mesh = new THREE.Mesh( new THREE.PlaneGeometry( 20000, 20000 ), new THREE.MeshPhongMaterial( { color: 0xffffff, depthWrite: true } ) );
scene.add(mesh);
mesh.rotation.x = -Math.PI/2;
mesh.receiveShadow = true;

but when I use color ‘0xCCCCCC’, it can create shadows

Maybe ambient light intensity very big or directional light

Thank you. I understand that it has something to do with setting the ambient light,I’ve adjusted it so I can see the shadows.

I have one more question,if the ground is set to render no color , the shadow will not show, how to adjust this?

mesh.material.colorWrite = false

I dont know about this setting “colorWrite”.
One time i saw matrial or mesh where was only shadow

[…] if the ground is set to render no color , the shadow will not show, how to adjust this?

Shadow map is a “property” applied to materials - so, in most cases, if the material is not visible or does not support shadow maps (ex. MeshBasicMaterial), shadows will not be visible either.

  1. A simple way would be to just clone the plane and apply ShadowMaterial on that clone (example, lines 20-25.)

  2. Another way to go around it, and a bit prettier too, would be to use ContactShadows (source code). Keep in mind these aren’t real shadows (they don’t even require lights present), they are just a projection of all objects on a plane geometry, that is then blurred to imitate ambient occlusion + shadows.

Thank you very much. I chose the first option