Shadows stop working when using a skybox

Hello,
I finally got some shadows working in my scene. But when I activate a skybox using the following code, the shadows disappear.

var skybox = BABYLON.MeshBuilder.CreateBox("skyBox", {size:500}, scene);
var skyboxMaterial = new BABYLON.StandardMaterial("skyBox", scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = skyTexture;
skyboxMaterial.reflectionTexture.coordinatesMode = BABYLON.Texture.SKYBOX_MODE;
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
skybox.material = skyboxMaterial;	

What should I consider regarding this?

Check your light’s position, it need to be inside the skybox, as skybox will block the light.

https://playground.babylonjs.com/#IFYDRS#876

i checked it and the size is large enough. but it became even weirder. i added this skybox.setEnabled(false); for testing purposes and the shadows still disappear. no, they don’t disappear, but they point to another direction and seem to not use the actual geometry.

here is a screen shot. top without the skybox code, bottom with skybox.

It seems skybox is added to your shadow generator after creating. As skybox is big enough, stuffs is too small to have one pixel on shadow map. Check line 54

https://playground.babylonjs.com/#IFYDRS#877

but in your example the skybox is added to the shadowcasters and i did even tried using removeShadowCaster and it still happens.

We need a repro in the playground in order to help you troubleshoot

hm, when creating the playground, it works. now i am even more confused.

is it possible that it has something to do with the glb i am using (exported from blender)? importing it into the playground from our server space didn’t work. so i cannot test it.

the only other difference between the playground and my scene was that i used some other hdr files i found on hdrihaven.

You can try this for your assets Babylon.js docs