When adding additional directional lights, my shadow disappears. How do I keep this shadow intact?

Hi all, super new to Babylon! I’m trying to illuminate a chair with several directional lights, with only one of them casting shadows. The shadow works great, but if I uncomment any of my 3 additional directional lights, the shadow disappears.

How can I show these additional lights, but have the original shadow remain intact? Thanks for any help! Playground below:

Hi Dillon, welcome to the forum!

I think ShadowOnlyMaterial uses the first light added to the scene, so to do what you want you can …

  1. Use ShadowOnlyMaterial.activeLight: Example playground.
    or …
  2. Create the shadow light first, before the non-shadow lights: Example playground.

Amazing. Thanks for the example solutions and explanations!

1 Like