Did we lose the ShadowOnly Material?

Babylon.js engine (v3.3.0) launched
(index):53 Uncaught TypeError: BABYLON.ShadowOnlyMaterial is not a constructor
at createScene ((index):53)
at (index):59

It works in the playground though.

Well then if it works in the playground this is that you may have missed a ref to the material itself?

its coming from the CDN. I even switched to the preview version just to check.

Even when I console log out BABYLON and search the module list its nowhere to be found?

you are referencing https://cdn.babylonjs.com/materialsLibrary/babylonjs.materials.min.js ?

Nope, thought those came by default. I bet that will fix it thanks!

1 Like

I was able to stop the error, but now as I try to use it I am seemingly doing something wrong.

Can it only take one shadow generator?

https://playground.babylonjs.com/#BVXVZY

Here without the material the shadow casts.
https://playground.babylonjs.com/#BVXVZY#3

Im sure Ill be able to figure it out, I just don’t feel like bodunking with it.

Did you try the demo from the doc?
https://doc.babylonjs.com/extensions/shadowonly

1 Like

hmm odd when I was googling it I could not find that for the life of me… must have been rushing.

1 Like

Perfect Thank You!

wonderful! (looks like zelda sword :))

Hi @Pryme8,

How did you manage to have several shadows using ShadowOnlyMaterial?
I tried to play with includedOnly & excludedOnly properties of the lights as explain in the shadowOnly documentation but it doesn’t work: https://playground.babylonjs.com/#BVXVZY#4

Thanks for your help

I think I used multiple shadow systems.

So you created one new ShadowOnlyMaterial for each light?

Yeah and I think and a plane for each one too if I remember right.