I want to ask a question. When I use the shadow parameter, the ground in the scene disappears,

I want to ask a question. When I use the shadow parameter, the ground in the scene disappears, but the ground appears when I set groundMesh.receiveShadows to false. I wonder if the ground created by CreateGroundFromHeightMap cannot use this method. , or where am I going wrong?
var light1 = new BABYLON. DirectionalLight(“dir01”, new BABYLON. Vector3(0, -1, -0.3), scene);
const groundMesh = BABYLON.Mesh.CreateGroundFromHeightMap(“ground”, “static/img/heightmap.png”, 1000, 2233, 100, 0, 70, scene, false);
groundMesh.position.x=0
groundMesh.position.y=0
groundMesh.position.z=0
var sphere = BABYLON. Mesh. CreateSphere(“Sphere”, 160, 3, scene);
var shadowGenerator = new BABYLON. ShadowGenerator(1024, light1);
shadowGenerator.getShadowMap().renderList.push(sphere);
shadowGenerator.useBlurExponentialShadowMap = true;
shadowGenerator. useKernelBlur = true;
shadowGenerator. blurKernel = 64;

     groundMesh. receiveShadows = true;

There is nothing different in the ground created from heightmap and it receives shadows just fine: Ground From Height Map Examples | Babylon.js Playground (babylonjs.com). You should probably first check your console to see if there aren’t any errors. Otherwise, you should share a playground with us so we can properly see your code.

1 Like