Unable to view the shadow under spotlight

Hi,

using blender3.2 we created a scene with walking person under spot light.
While exporting from blender as .glb selected the option “punctual lights” but it is not reflecting at babylonjs

i tried using

var generator = new BABYLON.ShadowGenerator(1024, light);
generator.usePoissonSampling = true;
generator.bias = 0.000001;
generator.addShadowCaster(newMeshes[0], true);

didn’t work out

reffered other links, but no luck

can somebody throw some light here…

Thanks
vijay

You can’t use an hemispherical light to generate shadows, only point, spot and directional lights are supported (point lights should be avoided when possible, as they consume quite a lot of GPU resources).

In your scene, Point.001 is a spot light and generates the circle of light on the ground.

So, you can do something like this:

1 Like